On 26 June 2015 at 11:11, Matthew Brush mbrush@codebrainz.ca wrote:
On 2015-06-20 08:12 PM, Matthew Brush wrote:
Hi All,
I just noticed that the new spawn code exposes almost every single bit of API possible. Do we really want to do that, or should we limit it only to what is currently needed by any plugins? A quick survey of Geany-Plugins shows no usage of any of this yet.
IMO, we shouldn't expose anything which is not needed by plugins, especially if it's not related to the plugin API.
On IRC Colomban had me look at what spawning G-P plugins did (I looked at C code only).
The result is that there are twelve g_spawn* calls which should be migrated to spawn_* equivalents. At least for those that use commands input by the user so the quoting is the same as Geany.
There are five that use utils_spawn (which uses spawn_* internally) and they also should be migrated if they do their own command decoding.
The above migrations will allow plugins that do their own decoding of commands to be simplified and become consistent.
There is also a custom spawn in geanyctags, I didn't look at what it did differently.
One further thought before we get locked into the exposed API.
Shouldn't all the spawn stuff be in the utils_* namespace? From the plugin developer perspective it's just some more utility functions like the ones it improves upon already in the utils_ namespace and that seems to be the place where we dump all the general purpose convenience functions and stuff that makes up for GLib short-comings, and that's effectively what this is.
It was proposed to make spawn a library, that would mean a separate namespace would be better.
If we wanted to keep the file-wise isolation of the spawn code, we could just tweak the Doxygen comments a bit to put the functions under that section of the API docs, rather than giving a handful of helper functions their own whole "module" (API-wise, ex. "namespace" and docs).
Is there a "misc" section? :)
But otherwise yeah, the utils section of the manual seems ok.
Any opinions?
Cheers, Matthew Brush
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel