-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-save creates backup #file# after renaming the file #10348
Comments
Setting |
@CeleritasCelery
My understanding is that |
That would be no different then a regular save.
|
I want a regular save every 30 seconds automatically. |
You could write a function that saves the buffer on a timer. Shouldn’t be too hard. Though the question is, why don’t you want to use the builtin auto save? It’s more flexible because it won’t overwrite your file when you don’t want to. |
I want to auto-save to the original file because my Linux desktop crashes often, and it's easier to reboot and just keep going, rather than go through the file-recovery dance. |
Then you will have to roll your own implementation. |
Normally my Spacemacs auto-saves to the original file as described in the documentation. Reproduction guide :
*Observed behaviour: But after SPC f R (spacemacs/rename-current-buffer-file) renaming the file, the auto-save behavior changes to saving to a #file# stored in the same directory (as described at the top of this thread). I think that change in auto-save behavior is a bug, or a very strange feature. |
Looks like you were correct about the implementation of |
@CeleritasCelery thanks for the validation. Losing file edits at seemingly random times was confusing me for weeks before I figured out the pattern. |
Just to throw out another use case for auto-save on the original file - I sync my org-mode files across different computer using DropBox and the files tend to be actively open on the different machines. I don't always remember to save before I switch computers (e.g. leaving my work computer and going home), so my changes weren't always being propagated between machines and I was getting conflicts. By auto-saving every 5min things stay better in sync, and by the time I sit at the other computer the changes have propagated to the open buffer (though lock files are still a problem, as in #10347). Maybe there's some other configuration where emacs would do a better job of noticing when an auto-save file is newer than the currently open one, but that wasn't happening. |
Is there some work-around where we can edit how long it takes to auto-save? That might get us a better feedback loop on if there's an error (e.g., you'd see it in your git status faster). Or even better, save on focus to another window. |
Found some documentation here: https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#auto-saving The original PR implementing it might be useful too: #1484 |
@wolfv6 Your comment above seem to have resolved the issue; if anything fancy is required, there are packages users can download and configure. Maybe consider closing this issue? |
This is no longer an issue. Solution documented at |
Auto-save creates a backup #file# after renaming the file.
This is in my .spacemacs file, defun dotspacemacs/init () (setq-default :
So all saves should be saved to the original file, and NOT saved to an auto-save #file#
Saves are NOT to the original file. This could confuse new Spacemacs users enough to cause them to lose data. Please consider making this issue a High Priority.
This might be related to #7927 #10347 #10327
Reproduction guide 🪲
Observed behaviour: 👀 💔
Auto-save #file1# is created.
All saves (SPC f R or auto-save) are to auto-save #file1#.
Expected behaviour: ❤️ 😄
No auto-save #file1# is created.
All saves are to the original file1.
System Info 💻
(c-c++ emacs-lisp evil-snipe git ivy org shell spell-checking)
Backtrace 🐾
The text was updated successfully, but these errors were encountered: