[Geany-devel] Patches required by gproject
nick.treleaven at xxxxx
Fri Jun 18 11:26:56 UTC 2010
On Thu, 17 Jun 2010 22:56:06 +0200
Jiří Techet <techet at gmail.com> wrote:
> >> [PATCH 1/3] Add a signal that is emitted before build starts
> I want to be able to save all project files before the build starts.
> Currently geany saves only the active file but does nothing with the
> other open files, so you may be compiling the old version. I think
> emitting the signal before build might be useful for other plugins too
> (e.g. if they pre-process the files before the build and so on)
OK, I'll add the signal.
> >> [PATCH 2/3] Make it possible to fill some fields of find in files dialog by plugins
> There are two fields that I find it useful to pre-set in the find in
> files dialog:
> * the path - my plugin displays a project file tree in the sidebar and
> right-clicking a folder and selecting "find in directory" pre-fills
> the directory in the dialog for the user. This saves a lot of time
> especially when the directory structure is deep.
(The File Browser also does this).
> * extra options - in my plugin the project files are defined by a set
> of patterns, so by providing a base path and patterns like
> *.c;*.h;*.am he defines the files he'll see in the sidebar and that
> are "inside" the project. Search in project files applies only to
> these files (and for big projects you really don't want to search *.o
> and others) so you need to restrict grep by something like
> --include=*.c --include=*.h --include=*.am
> Unfortunately the more file types you have, the more typing it
> involves so the plugin does this for you.
I like the idea, but I'd rather not allow plugins to override the
'extra options' field - this is a user setting.
I think this feature could be part of Geany - we already have a
(currently unused & hidden) 'patterns' field which is meant to hold
something like "*.c;*.h;*.am".
Then we could add a FIF dialog checkbox 'Use project patterns'. That
also allows the user to still do normal searches outside the project.
That option would also be useful to search files with no extension -
README, ChangeLog, NEWS, etc without having to add all those filenames
to the pattern.
> I can imagine that other plugins might find it useful to change the
> "search for" field and that the "extra options" checkbox might be also
> plugin-settable so I could add those too if you wish.
I'd prefer to only add things when there is a good use case for them.
> >> [PATCH 3/3] Open files from msgwindow even if find_in_files_dir is not set
> Currently if you want to open a file by double clicking the filename
> in the msgwindow (e.g. after searching in files), the file is opened
> only after the project had been opened for the first time (subsequent
> closing the project doesn't matter). The reason is that
> find_in_files_dir is initialized to NULL and only set when you open a
> project and if the project is not open because
> msgwin_parse_grep_line() stops on
> if (string == NULL || msgwindow.find_in_files_dir == NULL)
> even though it might try to find the file when the provided path is
> absolute. I don't see any reason in this behaviour and the patch is
> pretty trivial.
I think the bug might be that msgwindow.find_in_files_dir
somewhere didn't get set - I'll look into it.
More information about the Devel