Hi all,<br><br>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.<br><br>Currently the operation is:<br>

<br>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.<br>
<br>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:<br>-
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)<br>
- 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)<br>
<br>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.  <br>
(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)<br>
<br>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.<br>
<br>Suggested addition<br><br>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.  <br>
<br>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).<br><br>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.<br>
<br>Please let me know agree/disagree.<br><br>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.<br>
<br>Cheers<br>Lex<br>