<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 October 2013 13:09, Matthew Brush <span dir="ltr"><<a href="mailto:mbrush@codebrainz.ca" target="_blank">mbrush@codebrainz.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 13-10-23 11:36 AM, Thomas Martitz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[snip]<br>
</blockquote>
<br>
Regarding that pattern we discussed previously and used in this AutoClose code for attaching data to a document, I'd be interested whether you or anyone thinks this branch (last/top two commits) would be useful to plugins:<br>

<br>
<a href="https://github.com/codebrainz/geany/commits/document-datalist" target="_blank">https://github.com/codebrainz/<u></u>geany/commits/document-<u></u>datalist</a><br>
<br></blockquote><div><br></div><div>IIUC several plugins already use various methods of storing data for different documents and other Geany data structures.  Having a common way of doing that which cleans up when the Geany struct is destroyed is a good idea.</div>
<div><br></div><div>But it seems a pity to have to duplicate the glib interface for each structure that offers the facility, can we just return the GData and let the plugins use the normal g_datalist functions?</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
IMO it'd be better to make GeanyDocument an actual GObject and get the data lists for "free", but at least this is sort of a step in the same direction.<br>
<br>
Disclaimer: I have no interest in "defending" this or hashing it out, it's just one of my many local branches and hasn't been really tested. If anyone doesn't like it, or spots some bugs or something, they can just not saying anything (ie. I'm not asking for Code Review) and it will quietly go away, if anyone really likes it, they can push it forward and we can review and discuss it at that point.<br>

<br></blockquote><div><br></div><div>Don't try to make special conditions that say your contributions must not be discussed/reviewed, thats rude, its like saying you think you are better than the other contributors on this list.</div>
<div> </div><div><br></div><div>Cheers</div><div>Lex</div><div><br></div><div>PS On the recycling of doc structures and doc->is_valid, this does have the advantage (for a structure where miscellaneous pointers to the structure are going to exist in Geany and plugins) that doc pointers will always point to a geanydocument struct.  So the is_valid test is always right.  If the memory was returned and re-cycled into some other struct, the old doc pointers could point to anything, and could just as easily appear a valid document.  So its safer than the alternative, but the requirement to check is_valid really does need more visibility since its an unusual idiom.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Cheers,<br>
Matthew Brush<br>
<br>
______________________________<u></u>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-<u></u>bin/mailman/listinfo/devel</a><br>
</blockquote></div><br></div></div>