[Geany-devel] [PATCH] Behavior of opening filenames with colons from the command line

Lex Trotman elextr at xxxxx
Mon Aug 16 02:50:28 UTC 2010


On 16 August 2010 11:57, Colomban Wendling <lists.ban at herbesfolles.org> wrote:
> Hi Lex!
>
> Le 16/08/2010 03:25, Lex Trotman a écrit :
>> Hi Colomban,
>>
>> I am not criticising your attempt at improving this, instead I think
>> the whole idea of trying to have the line and column info on the
>> filename is wrong and will NEVER always be right until we make Geany a
>> mind reader (although if its reading my mind it will probably still be
>> wrong :-) because we can't think of all the ways "inventive"
>> programmers will come up with to structure filenames with :nn on the
>> end.
>>
>> The +line --line and --column options are there to give an unambiguous
>> position and the :line:col capability should be removed.
> Even though I totally agree that the :line:column filename-suffix cannot
> be guessed right in all cases, and will never can, I think it is really
> convenient.
> Why? because many tools (compilers, grep, etc.) outputs the line/column
> information this way. This means that to open the correct file at the
> correct line after a `rgrep -n` the only thing I have to do is to copy
> the whole string (which generally can be selected in a single operation
> since it is considered as a single "word") and pass it as an argument to
> geany, and, how wonderful, it does exactly what I expect!

I know, thats why I checked vim & emacs to see if its something that
users could "expect" Geany to do, but it doesn't appear to be

I vaguely remembered them doing it a long time ago, but the memory
might be faulty, or the capability might have been removed due to the
sorts of problems identified here.

> The other syntax are good and ways stricter, but aren't as useful IMO
> because (I speak for me) we generally don't want to open a file on a
> specific line unless we got that line information from somewhere else --
> which is often gcc or grep.

But Geany parses the output of compiles/greps etc run from within it
where it knows that the :line:col will always be added and then you
can just click on the line in the message window.  Perfect for Lazy
Programmers (TM), ie me

>
> This said, again, I don't (want to) believe that people create /real/
> files that ends with :nn.

Well, I've seen systems where its used.  Of course its not common or
there would probably have been lots of comments by now.

 I played with this kind of suffixes only after
> seeing the bug report, and only for the sake of it. Then I'd totally
> understand that you -- or anybody reasonable, not me ;) -- don't want to
> waste more time on this "issue" :)
>
>> Just in case it was common I checked vim and emacs documentation and
>> AFAICT neither does it.  Emacs supports +line:col as an arg but not
>> part of the filename.
> I don't believe that this should prevent Geany to do so if it is a good
> idea :) But perhaps it means it isn't a good idea...

I think its not a good idea as the default since Geany can be used by
other software (eg filemanagers) to open/create files with any name.

But maybe add a command line option to specify that the filename IS
suffixed with :line:col so you can still paste terminal output.
Perhaps -a and --at.

Cheers
Lex

>
> Cheers,
> Colomban
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>



More information about the Devel mailing list