Hi Colomban and all interested parties,
See git://github.com/elextr/geany.git filetype_plugins branch.
Warning, barely tested :)
The question is which paths to use for the filetype plugins, at the moment its absolute, but that isn't suitable in the long run. I suggest looking in "plugins" subdirectory relative to the filetypes files as well as the normal system locations. This means that all the (future :) filetypes plugins don't get loaded each time the plugin manager is opened, which is what happens with plugins in the standard locations. But a filetype can still activate a standard plugin from geany_plugins for eg.
Loaded filetype plugins appear in the plugin manager, so you can deactivate them if you want to, but they can't be reloaded until the filetype is reloaded. Makes sense to me.
There are some nasties because filetypes can be loaded asynchronously while the plugin manager is open, with both using the active_plugins_list (at least). I have currently simply locked out (silently) all file loading whilst the pm is open because it isn't until way into the loading process before the filetype is determined and so the decision to load another filetype is made and plugins may be loaded.
Cheers Lex
PS Colomban and Matthew, no not lexers or parsers :)
Note this branch is *not* a pull request. It is intended purely as a demonstration that using plugins for filetype specific actions can be hidden from the user by autoloading the plugins when the filetype is loaded.
When a suitable plugin is developed (and it looks like indenting will be first) this branch can be updated and applied to master.
On 18 January 2013 19:31, Lex Trotman elextr@gmail.com wrote:
Hi Colomban and all interested parties,
See git://github.com/elextr/geany.git filetype_plugins branch.
Warning, barely tested :)
The question is which paths to use for the filetype plugins, at the moment its absolute, but that isn't suitable in the long run. I suggest looking in "plugins" subdirectory relative to the filetypes files as well as the normal system locations. This means that all the (future :) filetypes plugins don't get loaded each time the plugin manager is opened, which is what happens with plugins in the standard locations. But a filetype can still activate a standard plugin from geany_plugins for eg.
Filetypes only need to list the .so name, searches the user config dir/filedefs/plugins and system config dir/plugins then standard plugin locations. Plugins from the first two locations will not appear in the plugin manager even though they are active.
Cheers Lex