most portable way is to make paths relative to something known:
- to where the executable is (argv[0])
- to user's home folder ($HOME env var)
Lots of programs use PATH approach, where they define order at which they 
search path list. For example they start at (in your case) prefix, then (if not 
found) at relative path to user's home, then (if still failed) at the relative 
path to executable's directory, etc.

Yeah, the environmental variable would work well as well. And I agree with you 
that this is not a bug, but a feature request.

Notably I wanted to bring up a rarer example from what most people deal with in 
general, to defend the author of this issue. It may not be a very urgent need, 
but most definitely would make things easier.

I hoped that someone on this project would have free moment to review this, 
because I assumed that for someone who knows the structure of Geany's source 
code, this could be quite easy task. If you know what to look for, I imagines 
it almost Ctrl+F type of work, and replacing every occurrence of prefix 
constant in the source code with a function call, and finally writing that one 
function which would solve the path dynamically according to a logic like I 
suggested, where the prefix used to build would still have the highest 
priority, but on failure, there would be few other paths to check. In fact I 
could even myself write this kind of function, but I would need to know where 
to look for all the places that prefix is used, to replace it with the function 
call. Maybe someone would be willing to assist me, and we could have it done 
within next few days. I think that the value from this feature would by far 
exceed the time needed to implement it. Unless of course Geany code is not well 
structured, which I don't know.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/788#issuecomment-348679424

Reply via email to