<blockquote>
<p>The reason that the save should go ahead is because the operation being performed is "Save As". The rename function is only a secondary convenience function to save deleting the original file.</p>
</blockquote>

<p>But there are no other ways to implement a rename operation on the file, because in the end you want to have the "document-save" signal to be put in one place.  So renaming a file is much just like saving.  I actually tried to separate <code>Rename</code> from <code>Save As</code> but I just ended with that problem.  <code>Rename</code> in the context of Geany is a save operation, but with a necessary step that it first has to rename the source file.</p>

<blockquote>
<p>And if you have "safe" or "GIO" file saving set the sequence is "rename original file, write new data to a new file, rename it over the just renamed original file" :-P</p>
</blockquote>

<p>I find that unnecessary overkill.  There are even more issues that you'd end up with that, and some errors to consider, and what to do when they happen like how you'd abort or how you'd revert changes (the temporary file).  That also wouldn't guarantee that the file is actually renamed.  If a filesystem or OS requires that a filename be not touched when some other processes are using it, then you might end up saving to the original file but not being able to rename it.  To put it simply, that's a lot more complicated and is more prone to more issues.</p>

<blockquote>
<p>The "Save As" dialog should offer to "Remove original file after saving".</p>
</blockquote>

<p>Not a bad idea.  Just rename the "R_ename" button to "Save and R_emove Original", or something else, because it would be less convenient if we remove the button and use a CheckBox.  It's actually more correct that way since it's technically in the context of "saving".</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1180#issuecomment-240954951">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ4eIPkcY_enT_msD4Jwn0QvYvAYRks5qhWPrgaJpZM4JnQzb">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ-XmENq09tMHxJed7IBu0tfns9iMks5qhWPrgaJpZM4JnQzb.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/1180#issuecomment-240954951"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@konsolebox in #1180: \u003e The reason that the save should go ahead is because the operation being performed is \"Save As\". The rename function is only a secondary convenience function to save deleting the original file.\r\n\r\nBut there are no other ways to implement a rename operation on the file, because in the end you want to have the \"document-save\" signal to be put in one place.  So renaming a file is much just like saving.  I actually tried to separate `Rename` from `Save As` but I just ended with that problem.  `Rename` in the context of Geany is a save operation, but with a necessary step that it first has to rename the source file.\r\n\r\n\u003e And if you have \"safe\" or \"GIO\" file saving set the sequence is \"rename original file, write new data to a new file, rename it over the just renamed original file\" :-P\r\n\r\nI find that unnecessary overkill.  There are even more issues that you'd end up with that, and some errors to consider, and what to do when they happen like how you'd abort or how you'd revert changes (the temporary file).  That also wouldn't guarantee that the file is actually renamed.  If a filesystem or OS requires that a filename be not touched when some other processes are using it, then you might end up saving to the original file but not being able to rename it.  To put it simply, that's a lot more complicated and is more prone to more issues.\r\n\r\n\u003e The \"Save As\" dialog should offer to \"Remove original file after saving\".\r\n\r\nNot a bad idea.  Just rename the \"R_ename\" button to \"Save and R_emove Original\", or something else, because it would be less convenient if we remove the button and use a CheckBox.  It's actually more correct that way since it's technically in the context of \"saving\"."}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1180#issuecomment-240954951"}}}</script>