Author Topic: Another Reason to try the Interpreted Languages plugin  (Read 11257 times)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Another Reason to try the Interpreted Languages plugin
« on: June 27, 2007, 10:55:03 pm »
"Add to active project"

win32 build of CBIL Plugins Rev 49 and Code::Blocks rev 4188 and wx2.8.4 available here:
http://developer.berlios.de/project/showfiles.php?group_id=7745&release_id=13012

source from svn on the project page (see my sig). Documentation coming soon.

[attachment deleted by admin]

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Another Reason to try the Interpreted Languages plugin
« Reply #1 on: June 27, 2007, 11:39:16 pm »
Hi dmoore,

I have tried the plugin and it is really cool. As I am working every day with the plugin I am missing two features:

Adding a bookmark list to directories to enhance switching between often used dirs.
A context menu to access CVS or Subversion.

Even if Tortoise is not a Cross platform solution, a integration of a version control system within a file browser would be the best solution (win32, linux). Is there a long term goal to integrate such functionality in the file browser.

Bye,

Mario



Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: Another Reason to try the Interpreted Languages plugin
« Reply #2 on: June 27, 2007, 11:52:01 pm »
Nice one... will update in a minute.
In the meantime: Something I'm missing is a cleanup of the project files, namely:
- add custom variable "WX_CFG", leave it empty
- add custom variable "WX_SUFFIX", set it to "u"
- change the compiler include directory from "$(#wx.lib)\gcc_dll\mswu" to "$(#wx.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)"
- change the linker include directory from "$(#wx.lib)\gcc_dll" to "$(#wx.lib)\gcc_dll$(WX_CFG)"
- change the wx lib from: "wxmsw28u" to "wxmsw28$(WX_SUFFIX)"
- add a virtual target "All" and let it point to "default"
- (maybe) let the object output directory point to "$(#cb)\.objs\plugins\contrib\InterpretedLangs"

This would ensure compatibility with other contrib plugins... These are not really bug fixes.

With regards, Morten...
(...compiling now... ;-))

Edit: Done compiling - GREAT!!! WELL DONE!!! :-) :P
Hence Another thing I'm missing: For "critical" operations like delete, rename, move etc. I would like to see the file's name in question in the security question. Otherwise this not really is a helper... ;-)
« Last Edit: June 27, 2007, 11:57:59 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #3 on: June 28, 2007, 12:05:17 am »
Adding a bookmark list to directories to enhance switching between often used dirs.

yes, this was down on my list, so I'll increase its priority.

Quote
A context menu to access CVS or Subversion.

Even if Tortoise is not a Cross platform solution, a integration of a version control system within a file browser would be the best solution (win32, linux). Is there a long term goal to integrate such functionality in the file browser.

I don't know whether this project will ever be a good CVS/Subversion solution, but even now you can setup simple "svn actions" such as add, remove, update, revert, stat that respond to context clicks in the file explorer/project manager and dump output to a shell window (or a console window, or simply launch the executable outside of a shell). I still need to offer a few more substitutions variables in the command lines to allow more complex actions (such as prompts for additional filenames, text strings, passwords before running a comand). EDIT: and I also need to do graceful things like save modified files, possibly close open files, and refresh the tree when done.

see attached image for an example of the settings (EDIT: don't mind the error in the "Stat" action from my lazy copy/paste)

If someone was really serious about working on CVS/Subversion type plugins that wanted they integrate with the FileExplorer, it could be easily setup as a shared dll. Someone already had the foresight to create file image types for the various version control states in the CB SDK.

[attachment deleted by admin]
« Last Edit: June 28, 2007, 12:13:27 am by dmoore »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #4 on: June 28, 2007, 12:07:50 am »
Nice one... will update in a minute.
In the meantime: Something I'm missing is a cleanup of the project files, namely:
- add custom variable "WX_CFG", leave it empty
- add custom variable "WX_SUFFIX", set it to "u"
- change the compiler include directory from "$(#wx.lib)\gcc_dll\mswu" to "$(#wx.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)"
- change the linker include directory from "$(#wx.lib)\gcc_dll" to "$(#wx.lib)\gcc_dll$(WX_CFG)"
- change the wx lib from: "wxmsw28u" to "wxmsw28$(WX_SUFFIX)"
- add a virtual target "All" and let it point to "default"
- (maybe) let the object output directory point to "$(#cb)\.objs\plugins\contrib\InterpretedLangs"

This would ensure compatibility with other contrib plugins... These are not really bug fixes.

appreciate the advice!

Quote
Hence Another thing I'm missing: For "critical" operations like delete, rename, move etc. I would like to see the file's name in question in the security question. Otherwise this not really is a helper... ;-)

yes, you are right. I might also use the annoying dialog class (if that's possible), so users can control how many warnings they receive. undo would also be nice, but not sure how feasible...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #5 on: June 28, 2007, 12:35:14 am »
and THANKS for the feedback from both of you. :)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #6 on: June 28, 2007, 12:37:42 am »
btw, if things go wrong with your Interpreter Actions (or even if they don't go wrong) the code::blocks message log contains the full command line and the working directory.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Another Reason to try the Interpreted Languages plugin
« Reply #7 on: June 28, 2007, 11:36:28 am »
nice work - thanks !

will play with this plugin to get familiar with

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Another Reason to try the Interpreted Languages plugin
« Reply #8 on: June 30, 2007, 03:43:37 pm »
Very nice.
Will the filebrowser be released as an own plugin :)?

Offline lubos

  • Almost regular
  • **
  • Posts: 131
Re: Another Reason to try the Interpreted Languages plugin
« Reply #9 on: June 30, 2007, 04:35:15 pm »
will this be added also to nightly builds?

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #10 on: June 30, 2007, 06:08:26 pm »
Very nice.
Will the filebrowser be released as an own plugin :)?
yes, when I get around to it I'll optionally split it from the InterpretedLangs plugin. although it is fairly natural that the "Shell Extensions" accompany the file browser (i.e. in other words the interpretedlangs plugin is really nothing more than a bunch of tools to run shell commands -- I'm going to rename that interpreters menu to something more meaningful soon and optionally make it a sub-menu of the tools menu)

will this be added also to nightly builds?
don't know about that -- up to the chieftains. when 1.0 finally comes out you can count on it coming in easily installable binary form.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #11 on: June 30, 2007, 06:12:54 pm »
BTW for anyone compiling my svn from source, I checked in a version that highlights "clickable" files in the output to the Shell Terminal controls. You can double click on an error message (or in fact any text that looks like filename and line#) in the Shell Terminal output and be taken to the line in the code that caused the problem (provided that regex correctly interpretes the output). I won't release the binary build until I allow the option to switch this feature off (it will cause slowdown if there's lots of text to parse)

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Another Reason to try the Interpreted Languages plugin
« Reply #12 on: July 06, 2007, 11:25:34 pm »
Hi dmoore,

I want to compare and merge different files using the interpreter plugin.

The file explorer already support the selection of different files using the Ctrl or Shift key.
So I added an diff interpreter (kdiff3 works fine under win32 and linux) and added

Run;$interpreter $file;;;

What I need is the list of files I have selected with Ctrl or Shift,
Run;$interpreter $files;;;

This features could be also helpful using cvs, svn diff the working copy with the repository and pipe it to a diff program.

I have a suggestion: In the toolbar menu interpreter the command list of an interpreter are in a submenu. In the context menu of the file explorer the command list of all interpreter are not grouped. Is it possible to have the same structure in context menu like the toolbar menu for the commands.

Bye,

Mario

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #13 on: July 07, 2007, 12:38:40 am »
Hi Mario:

already implemented- use $mpaths (multiple paths - it doesn't distinguish between files or directories and there is no limit on how many you select - you will just have to remember to only click two files when you use it).

OH WAIT  :x... In a very recent SVN commit, I changed the ' ' separated list of paths to a '*' separated list - I think that might get sent to the command line (oops). I'll fix soon... If you are using an older version it should work ok, unless you have spaces in the paths (which is why I changed to the '*' separator).

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #14 on: July 07, 2007, 12:43:46 am »
I just commited a one line quick fix to the SVN (untested)

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Another Reason to try the Interpreted Languages plugin
« Reply #15 on: July 07, 2007, 01:04:30 am »
Thanks dmoore,

cool :D, I love this plugin, because I do not have to switch between different applications anymore and it is so powerful.

What about grouping the command list per interpreter in the context menu of file explorer?

Another question:
In the TortoiseSVN plugin post you wrote:
you can setup virtually the same thing for linux using my Interpreted Languages plugin to call the standard svn client:
http://forums.codeblocks.org/index.php/topic,6297.msg48252.html#msg48252
(of course you won't get Tortoise's pretty front end for commits, diffs etc)

As Tortoise can start GUI elements from the command line (see chapter Automating TortoiseSVN) using e.g.:
TortoiseProc.exe /command:update /path:"file1.txt"

this could be also used with the Interpreter Language, but I do not know if the quotes will cause a problem with the "$file" command. I am just trying to get it work with the interpreter plugin.

Where are the settings of the interpreter and command list entries saved?

As codeblocks supports personalities to save settings <personality>.conf and Pecan added it also for codesnippets <personality>.codesnippets.ini, it would be nice to have <personality>.interpreter.ini config file.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #16 on: July 07, 2007, 01:29:47 am »
Thanks dmoore,

cool :D, I love this plugin, because I do not have to switch between different applications anymore and it is so powerful.

glad you like it. it's funny -- I'm still coming to grips with it myself and evolving it as new ideas flow. keep the requests coming.

Quote
What about grouping the command list per interpreter in the context menu of file explorer?

yeah, it will get messy with lots of commands, so I'll implement something like this.

Quote
In the TortoiseSVN plugin post you wrote:
you can setup virtually the same thing for linux using my Interpreted Languages plugin to call the standard svn client:
http://forums.codeblocks.org/index.php/topic,6297.msg48252.html#msg48252
(of course you won't get Tortoise's pretty front end for commits, diffs etc)

As Tortoise can start GUI elements from the command line (see chapter Automating TortoiseSVN) using e.g.:
TortoiseProc.exe /command:update /path:"file1.txt"

I didn't realize this. I've only used tortoise briefly. the quotes won't cause a problem for single files or directories because variable substituion isn't that complex (be warned though, single files and dirs currently use the dos-compatible "short "path version of their name, multiple path selections won't be enclosed in quotes and will break if there are spaces in the path)

Quote
Where are the settings of the interpreter and command list entries saved?

at the moment it is all stored in the main .conf file. I'll think about putting it in a separate ini file later.

BTW i noticed that the main cb images directory contains a bunch of SVN state images for files. I can use these images in the file explorer by parsing output from the svn stat command (I'll have to put tree expansion code in a separate thread so it doesn't block the main app -- ultimately I'll probably implement a file listener to track changes in directories and update the open nodes of the file explorer tree automatically).
« Last Edit: July 07, 2007, 02:03:01 am by dmoore »

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: Another Reason to try the Interpreted Languages plugin
« Reply #17 on: July 16, 2007, 08:28:56 am »
Hi,

the Project View has a context menu "Find File". With this entry you can search for a file and hitting return will open the file in CB. This is very useful, because you do not have to unfold all the folders just to open a specific file. I think it would be nice to have a find dialog for directories and files within the file explorer plugin that mark them as selected and will make navigation faster.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Another Reason to try the Interpreted Languages plugin
« Reply #18 on: July 16, 2007, 01:37:24 pm »
I wrote the code to search for files that match a wildcard list several weeks back, but haven't written the GUI stuff yet as I couldn't decide the best way to present the results. Any thoughts?

On reflection, it might just be easiest to use the current wildcard filter option and just automatically expand all folders.