[Geany-devel] Directories for running build commands & latest build-system commit

Thomas Martitz thomas.martitz at xxxxx
Tue Jul 14 22:40:00 UTC 2009

Lex Trotman schrieb:
> Hi all,
> During the development of the build-system branch there has been a 
> suggestion that there needs to be an upgrade of the setting of the 
> directory in which build menu commands are run.
> Currently the operation is:
> Filetype commands are intended to be run on the currently open file, 
> so they always run in the source file directory.  This allows them to 
> be used for simple single file work without configuration, and allows 
> movement around more complex source trees, again without configuration.
> Non-filetype commands are a bit more complicated.  Since this group is 
> intended to run commands independent of the source file, in theory it 
> could be any directory, But there are a couple of likely candidates:
> - for make type builders to build the entire package the top of the 
> tree is the right place, that is a fixed directory (at least for each 
> package it is)
> - for make type bulders that build lower levels than the whole 
> package, then somewhere below the top of the tree is right, that isn't 
> a fixed directory (an example of where you use this is make doc in 
> geany's doc subdirectory)
> The current behaviour of Geany is to provide an approximation of both, 
> at least if you are using a project.  A fixed directory for all 
> commands for this package is provided by the base_dir of the project, 
> otherwise the directory of the current file is used as the most likely 
> place to run commands within the tree. 
> (Note although it is called the project base directory, I am not aware 
> of any reason why it can't be set to any arbitrary directory)
> When running without a project there is no base_dir available, so 
> Geany runs commands in the directory of the current file or not at 
> all.  This could be improved by having a preference for a common 
> directory (a base_dir for non-project use) and by having per-command 
> directories.
> Suggested addition
> Now that build menu items are fully configurable, Thomas has suggested 
> that there be a directory configured per command and I agree with him 
> for the non-filetype and execute commands, filetype commands should 
> always run in the directory of the file. 
> To select known directories such as the base_dir or the directory of 
> the current file, substitutions such as %p for project could be used 
> (like %e and %f in the commands).
> If one of the substitutions is the directory of the project file, then 
> all paths could effectively be made relative to the project file and 
> if it is in the source tree, so allow it to be moved around with the 
> source tree without re-configuration, and even checked into version 
> control and checked out in a working directory somewhere else.  This 
> would be really useful when a project configured special commands as 
> new users wouldn't have to re-configure them.
> Please let me know agree/disagree.
> There is a new commit in the build-system branch that makes the error 
> regular expressions work, I think.  I find it very hard to test since 
> you need a compiler or other command that outputs errors in a format 
> that Geany's built-in parsing doesn't recognise, and it recognises a 
> lot. If you have such an animal please try it out.
> Cheers
> Lex
Ah, I see you begin to understand where I was coming from :)

I think %d (for the directory of the current file) and %p (for the 
project's base dir) would already be sufficient for most stuff.

Here's the patch (sync'd to your latest changes) that allows for easier 
plugging in the working dir GtkEntry. It doesn't implement it yet, just 
makes later adding easier (I'm in favor of atomic comm its where 
possible, so the actual addition would be a seperate patch).

Best regards.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: working_dir.diff
Type: text/x-patch
Size: 22775 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090715/5f36dc91/attachment.bin>

More information about the Devel mailing list