> If the popup dialogue already has a "Save As" button, it would more 
> convenient to use.

Yes it would, but the impact may be a significant refactoring of the save code, 
since ATM `save-as` calls the normal `save` after it figures out the new name, 
but since `save` is not re-entrant it can't be called from a `save-as` which 
was called from `save`.  And that also makes another loop, though at least it 
has a user action in it.

The last thing a plugin would want to do is to re-implement save, remember 
there are three options that control how its done, each of which has a 
different use-case so it will reduce the utility of the plugin if they are not 
all available.  Also "save" isn't just writing the buffer to the file, there is 
the issue of encoding, and handling bad characters, and BOMs etc. 

And performing file metadata checks portably is not easy, and then they can be 
wrong if you are not fareful, we have had issues with remote filesystem data 
caches giving bad data (though hopefully we have solved that now).  It is not 
sensible to re-do that all in a plugin.

Yes, it is possible to change the API, but that then affects all the other 
plugins that use it.  Adding new API is also possible, but again that needs 
changes to Geany to make the new and old API work together.

And lastly save is a *critical* function as you have pointed out, we need to be 
very careful making changes to it, we don't want to introduce bugs in the 
normal save operations, that could affect *ME* :). 
Care is needed especially since its not as straightforward as it seems as noted 
above.  To quote a former Geany maintainer "Who knew that simply writing a file 
was so hard" ( :tm: Enrico)

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/815#issuecomment-165030367

Reply via email to