Fedora 21; Geany 1.24.1; gproject extension is enabled; "Store project file inside the project base directory" is on; project file /home/vdb/proj/assa/assa.geany, "base_path=/home/vdb/proj/assa". Everything is ok; project tab in the side pade filfulled with my project files.
Geany manual in "Project properties" section says: "The Base path field is used as the directory to run the Build menu commands. The specified path can be an absolute path or it is considered to be relative to the project's file name."
However, it seems geany treats non-absolute base path as relative to the user home directory, at least sometimes:
When I open project properties dialog and replace absolute project base path with "" (empty string) and then press "Ok" button, geany freezes for a long time. Geany does not load CPU, but does not respond to keyboard and mouse events. After some time it starts responding, and I see "Project" tab in the sidebar is fulfilled with directories and files found in my home directory. My home directory is rather big and deep, so it requires noticeable time to scan it.
Opening project properties shows that geany replaced empty string with "./". However, if I click "Ok" button (without any changes), geany says "The path "./" does not exist. Create the project's base path directory?". If I click "Ok", it freezes again (re-scanning my home). Meanwhile, geany creates a new directory "/home/vdb/proj/assa."
I done some more tests. My assumption that geany treats "./" as user home directory was not fully correct. When searching project files, geany treats "./" as a current working directory (while supposed it should be treated as a directory containing the project file). However, when checking directory existence (at closing project properties), geany appends "./" to the project file directory without intermediate slash, resulting in incorrect path "/home/vdb/proj/assa.".
On 11 April 2015 at 08:06, Van de Bugger van-de-bugger@users.sf.net wrote:
"./" is defined by Unix as the working dir, Geany should not treat it
as anything different.
However, when checking directory
Related
Bugs: #1094
"Current working dir" notion is great for shells. In a shell, you can find out current working dir by "pwd" command and change it "cd", "pushd", "popd" commands.
In a geany, there is no way to find out current working dir and there is no way to change it. What is working directory in geany? A directory where it was started? If I start geany from a desktop menu, what is the start up directory? Even if I start geany from the command line, it often opens specified files in previously started editor and immediately exits. In such a case, does it change current working directory or not? If I open a file using "Open File" dialog by pressing Ctrl+O, and go from one directory to another, does it change current working directory? If I browse files in "File" tab in the sidebar and open a directory by clicking on it — does it change current working dir?
Thus, geany's "current working directory" is not clear and not well-defined from user point of view. (Though, I understand that every Unix process has a current working directory.)
But what about this claim:
How can I specify path relative to project's file? If you reject ".", you'll have to invent another notion for a directory containing the project file.
Alternative could be changing current working directory when user opens a project file.
On 11 April 2015 at 22:45, Van de Bugger van-de-bugger@users.sf.net wrote:
If the path is not absolute it is taken to be relative, no "." is needed.
Related
Bugs: #1094
Really? I have project.geany file in a directory, and I want to use this directory as a project base path. Show me how.
BTW, in Unix if path is not absolute, it is relative to current working directory. Are you going to break this convention?
And, would you be so kind do not overquote.
Last edit: Van de Bugger 2015-04-11
On 12 April 2015 at 05:00, Van de Bugger van-de-bugger@users.sf.net wrote:
Ok, I thought you were trying to use "./xxx" as the base dir to get
"/dir/of/project/file/xxx", but you just need "xxx" for that.
The base path string "./" is special cased by Geany to mean
"/dir/of/project/file".
Cheers
Lex
Related
Bugs: #1094
Oops. I remember you said before:
Which one of these two statements pretend to be true?
And what if "." occurs in the middle of the path, e. g. "/dir/./another/dir/./."? Such a path is perfectly legal Unix file name, isn't it?
Thanks you very much for this valuable advice, but would you be so kind to get into account: it simply does not work, at least in geany 1.24.1. See the first two messages.
Thank for your support and understanding.
Thank you for the pointer back to your first message, you have
identified an error in the manual.
The line "The Base path field is used as the directory to run the
Build menu commands. The specified path can be an absolute path or it
is considered to be relative to the project's file name." is incorrect
and should have been removed when the build system was changed, will
raise a PR. To use a specific directory you need to explicitly say
that, see http://www.geany.org/manual/current/index.html#build-menu-commands-dialog
%p is probably what you want to get builds to use the base path
relative to the project file, this certainly works for me.
The behaviour of the project plugin is separate from Geany itself, if
you feel it is scanning the wrong directory you should report it to
the plugin developer as listed in
http://plugins.geany.org/projectorganizer.html (Note the plugin
recently changed its name).
Related
Bugs: #1094
The GProject (newly called ProjectOrganizer) plugin behavior is fixed in geany-plugins master now. Regarding Geany's behavior, it is known to be broken:
https://github.com/geany/geany/pull/32
My plan is to get rid of the base path settings completely as described here
https://github.com/geany/geany/pull/450
but the patch still needs some work.