<blockquote>
<p>Wait a minute, for the new_hooks you convinced me that <em>this</em> method flawed (due to the points you mentioned) and now you're trying to sell it to me? I'm confused.</p>
</blockquote>

<p>It's a little more subtle and a little less absurd than that :)</p>

<p>IIRC what you initially did in new_hooks was to fill in a struct to copy it back to the GeanyPlugin structure.  As I agree the funcs are part of the plugin itself, and as it has the above-mentioned flaws, I found it to make a lot more sense to fill the existing structure right away.</p>

<p>Here the thing I find odd is that I feel like the plugin itself and the proxy are two separate things, so filling the first to register the second seem odd to me.  They require calling 2 different register functions, but on the same structure.  That's the only reason why I somewhat try to find an alternative API I find more straightforward (for me).<br>
Do anybody else feel that way?  <a href="https://github.com/elextr" class="user-mention">@elextr</a> <a href="https://github.com/codebrainz" class="user-mention">@codebrainz</a> ?</p>

<p>Anyway, having</p>

<div class="highlight highlight-source-c"><pre>Proxy *proxy = proxy_new();
proxy->probe = my_probe;
...
<span class="pl-en">plugin_registre_proxy</span>(plugin, proxy);</pre></div>

<p>would basically make as much sense than the plain struct initializer solution, but requires adding more API (the _new()).  Not saying it's a great API either just now though :)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/pull/629#issuecomment-143062346">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ_5tDakXcyi5k8kq2CCZu2tcimZpks5o1GrxgaJpZM4Fy7fG.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/629#issuecomment-143062346"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>