Geany 1.25 on Fedora 22, installed from Fedora repos, SaveActions plugin enabled (both AutoSave and When losing focus).
Consider a scenario:
1. A file, say "Foo.txt", is open in the editor. 2. Focus switches to another application like a file manager, file "Foo.txt" is deleted outside of Geany. 3. Focus switches back to Geany: 4. Geany detects that file is deleted, and shows pane at the top of editing window with text "File "Foo.txt" was not found on disk! Try to resave the file?" and two buttons "Save" and "Cancel". 5. Now user presses "Cancel" button in the pane. 6. Immediately (the pane is still shown), a dialog entitled "Question" appears, with the same text and buttons. The dialog is modal, the main Geany window is not accessible. 7. User presses "Cancel" button in the dialog, it disappears. 8. Pane is still visible, so user has to press "Cancel" again. 9. User switches focus to another application, the file "Foo.txt" is saved with no questions.
Scenario varies, it probably depends on timing. Sometimes the first dialog appears even before user press "Cancel" in the pane, and after pressing "Cancel" in the first dialog, immediately appears the second.
Thus, user cancelled file saving at least 3 times , but it was saved anyway.
Geany and its plugins should communicate better and do not ask the same question again and again. If user cancels file saving, this file should not be autosaved (for example, newly created not-yet-named file is not saved when Geany loses focus).
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673
This appears to be *another* side effect of the extra check_status during file saving, see #605
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-145193289
As a general comment, autosave is there to protect your backside in case you or the software screws up.
As such it should always save if it has been set to do so. The situation where the file was deleted and the buffer is still open *SHOULD* autosave, thats what it is there for. Autosave doesn't know why the file disappeared, and safety software should never try to guess an intention.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-145194050
As a general comment, autosave is there to protect your backside in case you or the software screws up.
I do not agree. For protecting my ass "Save Actions" plugin have anoter feature: "Backup Copy".
Purpose of "Auto Save", especially "Save when losing focus" is quite different — let me work convenient with the same file using different applications: editor and web browser, compiler, or whatever else. When I switch from editor to web browser, editor automatically saves the file(s) so it could be displayed in web browser, or compiled, or whatever else without forcing the user to save file every time. Some editors even have opposite option — to automatically reload file if it was changed outside of editor. This facilitates editing the same file in two editors: text editor and some kind of "visual" editor.
I understand you as Geany developer can explain why Geany behaves in such a way. However, for me as a user, these explanations worth nothing. Geany three times asked me the same question, and finally ignored all my answers and saved the file. If the file should be saved anyway why Geany asked for confirmation? This is simply stupid.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-145281669
Whilst the autosave plugin can be used to provide the convenience semantics you use, it is also there to ensure documents have been saved in case Geany crashes, or logouts, or shutdowns. The backup feature doesn't help with that.
Agree there shouldn't be three requests, see my first comment for a reference to the likely culprit.
Even when thats fixed there will be one infobar asking if you want to save the buffer, which is the normal Geany behaviour when a file is deleted whilst open. This will occur irrespective of the autosave plugin being enabled.
But the Autosave plugin has no way of knowing that you told Geany to not save the file, it just reaches the timeout and does what it is told, it saves the file. That is as it should be, to ensure that the file is saved in case of crash etc.
You noted that the scenario varies, this is indeed dependent on when the autosave timeout happens relative to Geany detecting the file is missing.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-145405905
Let us be precise. I know nothing about "AutoSave" plugin. In my installation there is "Save Actions" plugin, which preferences consist of 3 tabs: "Auto Save", "Instant Save", "Backup Copy".
But the Autosave plugin has no way of knowing that you told Geany to not save the file…
Again, you are telling me about disadvantages of current Geany architecture. Look at the problem from user point of view. Geany asked a simple question: "Try to resave?". User replied: "No". It's very simple, isn't it?
That means, communication protocol between Geany and its plugin should be fixed or extended to provide a way to let plugin know the file should not be saved.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-145838980
I know nothing about "AutoSave" plugin.
"Autosave plugin" was just shorthand for "Autosave function of the Save Actions plugin", sorry for the confusion.
I am looking at it from the users point of view, but its a user with a different use-case to yours. That user has asked for autosave so they don't lose their latest changes because they are testing software that might crash Geany or the system. If the file is removed due to some external agency the user still wants the changes saved in case they crash. The file removal may not have been a direct removal by the user, it could have been a side effect of a Version Control checkout, a rename, a build, or for a remote file a glitch in the network, or it might be a result of the some bug. Whatever the case, this user *wants their changes safe*. That means autosave should try to save the file every n seconds.
Agreed the extra questions are annoying (I managed to hit a timing that caused a sequence of five dialogs/infobars :) but it needs something more sophisticated than simply telling the autosave to stop saving. An annoyance does not trump the safety use-case.
What is needed is for autosave to keep an exclusion list of files/directories it won't try to autosave so it won't simply ask again every n seconds. So I have changed this to an enhancement request. Contributions are welcome.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-146034689
That user has asked for autosave so they don't lose their latest changes because they are testing software that might crash Geany or the system. ... it could have been a side effect of a Version Control checkout, a rename, a build, or for a remote file a glitch in the network, or it might be a result of the some bug. ...
I do not agree with all the examples you mention above:
Version control checkout: Keeping files safe is a mission of source control. Source control will not overwrite your working files if they are changed. If they are not changed and overwritten than means they are already saved in VCS and safe.
Rename: If file renamed, user have the file, but under another name. Content is safe.
Build: If a file overwritten during build, that means it is a secondary file which was built form source files, and can be rebuilt again if needed.
Network problem: If a file is located on remote server and network is not reliable, it would be unwise to try to save it again in the same location because saving will likely fail. If you want to keep such a file safe, save it on local drive.
To me for keeping files safe "Backup Copy" should be used, not "Auto Save". Let it save backup copies not every "normal" save but every N seconds + in other emergency cases. Backup copies are created in dedicated directory, so if Geany saves a copy of intentionally deleted file in that dedicated directory, it will not irritate the user.
I managed to hit a timing that caused a sequence of five dialogs/infobars ...
Did you try to delete *several* files? You will have much more questions...
What is needed is for autosave to keep an exclusion list of files/directories it won't try to autosave so it won't simply ask again every n seconds. So I have changed this to an enhancement request. Contributions are welcome.
What do you mean under "contribution"? Fix in Geany code? We do not have understanding and agreement on the topic, so I do not think my contribution will be really welcome. BTW, submitting bugs *is* contribution, too.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-146120020
I think you missed the point of the use-case I was describing, to save the *changes* in the Geany buffer, not to protect files already on disk. All the points you make about the file being safe are irrelevant because the contents of the Geany buffer have not been saved to a file yet. The use-case of Autosave I am describing is to save the buffer contents periodically in case Geany or the system crashes.
And that list is just ways the file can be removed without the user *deliberately and explicitly* deleting it. If they deleted it then sure they probably don't want the changed buffer saved, at least not under that name. But with all the other ways the file can be inadvertently removed the need for the periodic save remains.
"Contributions" doesn't just mean you, other people may have thoughts to add. As you correctly point out a useful first "contribution" would be suggestions for a suitable design, since this is not a simple issue involving as it does asynchronous external operations, variable timing between autosave and Geany file checks, and several (potentially competing) use-cases.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/673#issuecomment-146192156
github-comments@lists.geany.org