[Geany-Devel] Adding a plugin

Roger Booth rbooth at xxxxx
Sun Jun 9 15:36:47 UTC 2013


On 06/09/2013 07:59 AM, Lex Trotman wrote:
>
>
>
> On 10 June 2013 00:43, Roger Booth <rbooth at kabooth.com 
> <mailto:rbooth at kabooth.com>> wrote:
>
>     On 06/09/2013 07:18 AM, Lex Trotman wrote:
>>     [...]
>>
>>     But if I'm going to *improve* the docs, I *still* have an
>>     outstanding (in a manner of speaking) question:
>>
>>
>>         Why does the function plugin_init() accept the one parameter
>>         GeanyData*?
>>
>>         The reason that is a question is that the three global variables
>>
>>         GeanyPlugin         *geany_plugin;
>>         GeanyData           *geany_data;
>>         GeanyFunctions *geany_functions;
>>
>>         are available to a plugin and you will notice that one of
>>         those global variables is geany_data which is suspiciously
>>         similar to the parameter to plugin_init().
>>
>>
>>     Yes it is the same.
>>
>>
>>         So either there is no reason to pass the parameter to
>>         plugin_init() or there is a good reason to pass the parameter
>>         to plugin_init().
>>
>>
>>     Since it is generally acknowledged that globals are bad, possibly
>>     someone started the process of removing the globals by switching
>>     to passing as parameters, but did not get time to finish the
>>     process or ran into other problems, but there is no indication I
>>     can find of why its that way.
>>
>>         [...]
>>
>>
>>     Cheers
>>     Lex
>>
>>         _______________________________________________
>>         Devel mailing list
>>         Devel at lists.geany.org <mailto:Devel at lists.geany.org>
>>         https://lists.geany.org/cgi-bin/mailman/listinfo/devel
>>
>>
>>
>>
>>     _______________________________________________
>>     Devel mailing list
>>     Devel at lists.geany.org  <mailto:Devel at lists.geany.org>
>>     https://lists.geany.org/cgi-bin/mailman/listinfo/devel
>     So when I document plugin_init(), you are OK with me saying that
>     the developer can use the global variable geany_data
>     interchangeably with the parameter to plugin_init(), and this
>     behavior will not change until -- gee, is this when the ABI changes?
>
>
> Yes that would be an ABI change, and an API change.
>
> I am not aware of anyone proposing to change this at the moment, so 
> you should be ok.
>
> Cheers
> Lex
>
>
>     _______________________________________________
>     Devel mailing list
>     Devel at lists.geany.org <mailto:Devel at lists.geany.org>
>     https://lists.geany.org/cgi-bin/mailman/listinfo/devel
>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
I thought you wanted me to propose enhancements to the documentation of 
the plugin API. If that is what we are talking about, then we are not 
talking about whether I am OK or not. What we are discussing is the 
defined API.

What I am asking is...

Is it a defined fact that the global variable geany_data and the 
parameter to the plugin_init() function can be used interchangeably?

Do the Geany developers swear on a stack of paper that this will not 
change until it does, and when it does, the docs will be changed to 
reflect that change and plugins will be given time (versions) to change 
behavior accordingly?

Is this the official position of the Geany developers?

Otherwise, what good is anything said here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130609/c8bdcd18/attachment.html>


More information about the Devel mailing list