Trouble disabling autosaves
(Edit: I solved this...see below for how.)
I'm having trouble disabling the autosaves. This doesn't work:
(setq auto-save-default nil)
Tried it on multiple Emacs versions as well (26.3, 27.1, and 27.1.91, all compiled from source).
As soon as I start typing in a file (eg, `Main.elm` I get this):
.#Main.elm -> [email protected]:NNNNNNNNNN
For what it's worth, that file doesn't actually exist when I try and read it.
Unfortunately, none of these suggestions are working either:
- https://www.reddit.com/r/emacs/comments/6knlbx/recommended_upgrades_to_emacs_autosave/
- https://www.reddit.com/r/emacs/comments/cthui8/saving_files_automatically_every_few_seconds/
- https://www.reddit.com/r/emacs/comments/1q1ezq/emacs_prevent_autosave_mess/
- https://www.reddit.com/r/emacs/comments/azqpjj/how_do_i_make_emacs_stop_autosaving/
I also tried a all of the linked packages, to no avail. I even tried to play around with the `auto-save-timeout` and `auto-save-interval` variables, but it wasn't helping. Also tried specifying all autosaves go to a particular directory...not working either.
Has anyone else not been able to get the typical methods of disabling autosaves to work?
(Note that moving backups to their own directory works fine...the autosaves are not however.)
Edit: I finally solved this (after spending way too long on it...) by looking at the Doom Emacs source code. So it turns out that those files were actually lock files. You can disable them like this:
(setq create-lockfiles nil)
Posted Feb 4, 2021, 9:51 AM UTC · edited
Hm,
(setq auto-save-default nil)seems to work just fine for me on Emacs v27.1As does
(set auto-save-file-name-transforms ¹(("." ,temporary-file-directory t)))(with auto-saving enabled, ofc)You could try using
auto-save-visited-modeto prevent the#*#temporary files? I have heard a couple of instances where very old installed packages were manually autosaving and ignored the variables.But I actually don't think that's what you're looking for. The symbolic link isn't the file's auto-save, it's the lock-file, if you have ever had the message that a different instance of Emacs is already editing the file, then this is why.
I think they can be pretty useful, but they do sometimes get in the way. I believe you can disable them with
(setq create-lockfiles nil).Edit: friggin' backticks on reddit... ¹ = `
You’re right about it being a lock file and not an auto save (thanks for the explanation). I didn’t realize it until after I posted and was reading the Doom Emacs source code.
What are you trying to do overall?
Why disable autosaves?
Technically I didn’t really want to disable them; just wanted them moved out of my source directory. But, the files I was trying to move we’re actually lock files not auto saves, so that’s why nothing I was trying was working.
I see. That makes perfect sense.