<blockquote>
<p><a href="https://github.com/codebrainz" class="user-mention">@codebrainz</a> mentioned the plugin's code is crap so perhaps it can be fixed inside it.</p>
</blockquote>

<p>I didn't mean to imply the code is crap per se, just that it doesn't handle any error conditions on saving, likely due to its authors having never experienced such a scenario. But yeah, I'm quite sure it could be handled by improving the robustness of plugin's code, without modifying the API.</p>

<p>Somewhat related, while poking around in its code, I did notice <a href="https://github.com/geany/geany/blob/master/plugins/saveactions.c#L268">a potential security issue/race condition</a> where the code circumvents a feature of <code>g_file_open_tmp()</code> that returns an open file descriptor, giving it the same problems as the old <code>tmpnam()</code> function. This should be easily fixable by just moving the <code>close()</code> function to the bottom of the block, after the <code>document_save_file()</code> call, assuming it inter-operates alright with Geany's various file saving strategies.</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/issues/815#issuecomment-165066842">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJwctKpmLuvBG-NRThxwVrDfHSwG8ks5pQTthgaJpZM4G04_e.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/issues/815#issuecomment-165066842"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>