Hello list,
Recent convert to Geany here! I love how it runs fast (*cough*Kate*cough), doesn't have any desktop-environment dependencies (*cough*Bluefish*koff), and uses a modern GUI toolkit (*cough*NEdit*hack). Please keep on trucking.
I would like to submit a patch (against SVN) to add two features that I've found very useful:
1. Allow specifying the line number in a document on the command line using traditional Unix "+NNN" syntax. This makes Geany compatible with tools like Cscope, and countless others.
2. Allow specifying the line number---and optionally the column---in a document on the command line using a ":NNN" or ":NNN:NN" suffix. This is not so traditional, but it means that you can (for example) cut-and-paste part of a typical GCC warning line...
foo/bar/baz.h:340:6: warning: "_MSC_VER" is not defined
...and very quickly have a usable command line:
$ geany foo/bar/baz.h:340:6:
(The trailing ":" is ignored. Yes, I know, you can invoke the compiler via the IDE, which parses the warnings... I often work with nightly-build log excerpts, however, so this is convenient for that.)
Implementation notes:
* GLib's option-parsing facilities can't handle "+" options. What I did was pull those out before GLib gets to them, replacing each with a new "--dummy" option that does nothing. This is better than handling the option after the fact, because then you have to write your own logic to remove the option from argv[]. (Or handle it as a special case when you parse the non-option arguments.)
* cl_options needs to be initialized before we look at the "+" option, lest we blow away the user's specified line number.
* get_line_and_column_from_filename() tries to be strict about the syntax of the line/column-number suffix, to help avoid unfortunate cases like
$ touch ifconf.08:00:69:02:10:05 $ geany ifconf.08:00:69:02:10:05
At most, it allows a trailing ":", for cut-and-paste friendliness.
--Daniel