Questions tagged [auto-save]

The generic concept of automatically saving information to the disk or to a remote server, triggered by a timer or any other event inside of Emacs.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Prevent emacs from automatically overwriting non-current auto-save file

I wanted to recover a file after a little unexpected shutdown. So I opened the file in Emacs and ran recover-this-file. Emacs responded with Auto-save file not current - fine, I thought, let me look ...
xeruf's user avatar
  • 344
0 votes
1 answer
38 views

Auto save files persist even when auto-save-file-name-transforms is changed

I have the following in my configs, (use-package files :custom (auto-save-file-name-transforms `((".*" ,786:BACKUP-DIR t))) (backup-directory-alist `(("." . ,786:BACKUP-...
scribe's user avatar
  • 1,035
0 votes
1 answer
53 views

Setting `auto-save-file-name-transforms` has the wrong effect: Auto-save files are stored in Emacs config directory

Assume I have the file ~/Documents/bla.org. Now I open a buffer that visits the file ~/Documents/bla.org. I check the value of the (buffer-local) variable buffer-auto-save-file-name, and it reads /...
Berber's user avatar
  • 125
1 vote
1 answer
47 views

Configuring dedicated directory for lock files and auto save files on MS-Windows

How do I configure a dedicated location for lock files and auto-save files that works on MS-Windows, GNU/Linux, and macOS? I'm using GNU Emacs 28.2 The following works on GNU/Linux but not on MS-...
Victor L's user avatar
  • 111
0 votes
1 answer
76 views

Save modes and properties on file basis

Files can have the same type (the same extension) and still have different kinds of contents for which I have different preferences. For instance, some text files are in English and some in Swedish, ...
njlarsson's user avatar
  • 111
0 votes
1 answer
241 views

Global Auto Save Visited Mode

I can't get auto-save visited mode to work. All I have in my config is this: (setq auto-save-visited-mode t) (setq auto-save-visited-interval 2) Should I need to enable anything else to get auto save ...
Jason Hunter's user avatar
1 vote
1 answer
287 views

How to disable the generation of auto-save files (e.g. #file.org#, .#file.org# and file.org~)?

I'm new to Emacs and org-mode. Whenever I make changes to any org file it creates auto-save files. For example if the file I'm editing is tasks.org, it creates these files : #tasks.org#, .#tasks.org# ...
Mikelenjilo's user avatar
0 votes
1 answer
70 views

How to never auto-save large files — or, how to run a function whenever any buffer starts — or, how to abort loading a minor mode in one of its hooks

I want to tell Emacs to never auto-save files bigger than ~1MB. I know how to turn off auto-save-mode when the file size is above a certain limit, but not how to make that function run automatically ...
Zorgoth's user avatar
  • 840
1 vote
2 answers
96 views

Is there a way to prevent Emacs from deleting an auto-saved file?

I frequently run shell sessions under Emacs (via C-x shell). My practice is to turn auto-saving on these shell-interaction buffers, so that the resulting (auto-saved) files serve as a persistent ...
kjo's user avatar
  • 3,247
1 vote
1 answer
61 views

Permissions for Auto-Save files

I use the configuration to store auto-save files in /tmp: (setq backup-directory-alist `((".*" . ,temporary-file-directory))) (setq auto-save-file-name-transforms `((".*&...
ceving's user avatar
  • 1,358
1 vote
1 answer
109 views

How can I save all buffers on auto-save except the ones have specifc mode?

I am using following full-auto-save () (https://www.emacswiki.org/emacs/AutoSave) to save all buffers on Auto-Save. (defun full-auto-save () (interactive) (save-excursion (dolist (buf (buffer-...
alper's user avatar
  • 1,370
0 votes
0 answers
12 views

Still getting autosave files in the same directory as my buffer [duplicate]

I have the following in my init file: (setq backup-directory-alist `((".*" . ,temporary-file-directory))) (setq auto-save-file-name-transforms `((".*" ,temporary-file-...
tedtanner's user avatar
  • 101
4 votes
1 answer
47 views

Buffer file replaced with lockfile/backupfile location

I have been suffering this issue for a few months, unable to reproduce it until now. In short, the issue is that when creating a new file, editing it, and then deciding to rename the file, the buffer'...
kballou's user avatar
  • 125
0 votes
0 answers
114 views

İs there a way to revert to last hard save?

If I understand correctly M-x revert-buffer reverts to the last auto saved buffer, as explained here. I just lost a big file (it was garbled for some reason). I opened the auto back up file but it was ...
zeynel's user avatar
  • 371
0 votes
1 answer
166 views

emacs still makes backup files even after I tell it not to [closed]

(I did restart emacs after adding config) I'm on GNU Emacs 28.0.50 (build 1, aarch64-apple-darwin20.5.0) of 2021-06-07 My config: (setq make-backup-files nil) ;disable backup (setq backup-inhibited t)...
american-ninja-warrior's user avatar
3 votes
2 answers
490 views

How to force Yes/y answer to `emacs has changed since visited or saved. Save anyway?` prompt

I am working in a git-repo using zsh shell. On the background, git-auto-fetch plugin is running in order to automatically fetch all changes from all remotes while I am working in a git-initialized ...
alper's user avatar
  • 1,370
1 vote
1 answer
29 views

How to resolve key-binding conflict between Icicles and `super-save-mode`?

I noticed that if Icicles is loaded then super-save-mode doesn't save a buffer when you switch to another buffer, though switching frames works. Icicles seems so technically advanced, yet there is no ...
Daniil Iaitskov's user avatar
0 votes
0 answers
40 views

auto-saved files in my current working directory despite I have set it to C:\temp\emacsbackup

I have the following line in my .emacs to keep auto-saved files in a specific directory: (setq backup-directory-alist (quote ((".*" . "C:/temp/emacsbackup")))) And it works, I see ...
tony's user avatar
  • 113
0 votes
0 answers
26 views

Each time I save a file, Spacemacs will try and parse my bibliography bibtex file. How can I stop that?

I use Spacemacs and it is great. But for some reason, each time I save a file--usually an org file, Spacemacs will try and parse my default bibtex file. And that file is relatively large, so it adds a ...
krishnab's user avatar
  • 519
2 votes
0 answers
71 views

Placing auto-saves in a different folder doesn't work

I am working on my personal emacs config and I wanted to keep .emacs.d/ uncluttered. So I created a temp folder inside .emacs.d/ that includes a backup directory. This part works fine. Also sending ...
Birne75's user avatar
  • 21
0 votes
1 answer
118 views

How to recover from a backup file

I can recover a file from an auto-save via M-x recover-this-file. So far so good. But how can I recover a file from it's last backup (if, of course, I have switched backups on)?
halloleo's user avatar
  • 1,341
0 votes
1 answer
271 views

How can I make Emacs put files named like .#filename into another directory too

I want my autosave files and backup files, e.g. #filename.org# and filename.org~ files, not to clutter the directory in my code repo that is in TypeScript. I have popped into a way to place inside ...
sçuçu's user avatar
  • 295
3 votes
2 answers
499 views

quick way to restore backups

The following happens fairly often to me: I do emacs note-xyz in the terminal to create a new note I write something in the note I forget to save before logging out Now I'm left with a file #note-...
user313032's user avatar
1 vote
3 answers
236 views

Is it possible to auto-save a file when focus is switch to another tab?

I am not sure that this possible but I have I two splitted panes while using tmux inside iTerm2 and I am using emacs daemon. I am using iTerm's keybinding to switch between tabs. One one of them emacs ...
alper's user avatar
  • 1,370
1 vote
2 answers
1k views

How do I auto save evil buffers for specific file types?

I'm a new Doom Emacs user that can't get used to having to save files manually. I found a way to auto save evil buffers, but the problem with this approach is that I'm not able step out of vterm (an ...
Hyperfocus's user avatar
1 vote
1 answer
166 views

Creating backup and auto-save files that are not hidden

I use the following code for backup and auto-save files: (setq delete-old-versions -1) (setq version-control t) (setq vc-make-backup-files t) (setq backup-directory-alist `(("." . "h:/...
Edman's user avatar
  • 1,207
3 votes
0 answers
299 views

How to disable tramp autosave and backups, but keep other backups/autosave?

I'd like to disable autosaves and backups when using tramp, because I neither want to save stuff from remote machines nor stuff belonging to root in my backup/autosave directory. How to do that? I ...
Max1's user avatar
  • 151
1 vote
1 answer
1k views

How do I disable savehist-autosave in emacs?

Because my emacs editor has become completely unreliable / unusable due to the frequent freezes - I'd like to disable this. But I can't figure out how? The actual issue is described by myself and ...
Chris Stryczynski's user avatar
1 vote
1 answer
44 views

How do I prevent the deletion of ~/.emacs.d/auto-save-list/.saves-PID-HOSTNAME~ files?

I recently upgraded to Emacs 26.3 from a much older version of Emacs (22.x). One of the many changes I've noticed with Emacs 26.3 is that the ~/.emacs.d/auto-save-list/.saves-PID-HOSTNAME~ files are ...
Ed Sabol's user avatar
  • 141
1 vote
1 answer
35 views

don't allow modification if there is autosave

is it possible to disallow modification if there is an autosave version? I sometimes save a file only to find out that it has an autosave version but I am unable to recover because I saved.
Joann Morris's user avatar
2 votes
2 answers
355 views

Emacs leaving behind files preceded with # despite lock files being disabled

I've noticed that emacs is leaving behind files in the directories of files I've edited with it. The files are named the same as the original, except the filename is preceeded and succeeded with a # ...
TheDarkHoarse's user avatar
1 vote
1 answer
63 views

Enable auto-save based on filename

How can I enable auto-save based on filename? I use a naming convention (a prefix to the filename) for my notes and I'd like to enable auto-save for those files.
jdigital's user avatar
  • 125
1 vote
1 answer
69 views

Getting call stack during call of a specific function

An automatic save is triggered (from some hook in some of my extensions) directly after a buffer is modified and I can't find the reason for it. The mode auto-save-mode is not enabled in the buffer ...
Nordlöw's user avatar
  • 507
0 votes
2 answers
95 views

Create many buffers, name properly, silently

I am trying to avoid using the desktop save mode 1 option in my .emacs file. We sudo a shared service account, so my buffers may differ from my colleagues buffers. I launch Emacs from GNU/Linux with ...
Scott Baker's user avatar
4 votes
1 answer
803 views

How can backup-directory-alist be set to save in the files directory?

I want the backup files to be created in sub-directories of the files being edited, and I have created a function returns that directory. (defun tempfilepath () (interactive) (concat (file-name-...
vfclists's user avatar
  • 1,413
5 votes
2 answers
859 views

Emacs wont reopen my files from recover session

I was working in emacs when had a power outage, so my computer was knocked offline. After I got the computer back up, I launched emacs and tried to restore the last session. Emacs then said: "No ...
9716278's user avatar
  • 183
0 votes
0 answers
87 views

Writing file when switching buffer

I'm using a rather stock Prelude emacs version with super-save disabled, but still whenever I change buffers using C-x o, whatever buffer I currently have focused writes to disk. I still want the auto-...
FullOnFlatWhite's user avatar
1 vote
1 answer
327 views

spacemacs and "file name too long" error on auto-save

I reorganized some of the folders on my computer, in an attempt to get rid of old stuff and organize useful stuff. So with the new directory structure, I am getting all of these auto-save errors. ...
krishnab's user avatar
  • 519
2 votes
1 answer
1k views

change auto-save directory

I defined these lines in my .emacs initialization file to change the location for backup and auto-save files. (defvar BACKDIR (expand-file-name "~/emacs_backup/")) (setq backup-directory-alist `((".*"...
manpmanp's user avatar
1 vote
0 answers
36 views

Possible to save winner history winner-ring-alist in savehist or desktop-save to save across sessions

I added in the following command to my .emacs but it doesn't seem to work: (add-to-list 'savehist-additional-variables 'winner-ring-alist) Is there a way to get the winner-undo history to save ...
J Spen's user avatar
  • 171
3 votes
1 answer
471 views

How to automatically save buffer after each modification without using packages

I'm using Emacs and Windows 10 and I am fairly new to both Emacs and elisp (and I am not a programmer). I'm looking for a way to automatically save a buffer immediately after any modification ...
John Doyle's user avatar
3 votes
1 answer
108 views

How do I prevent backups of scripts from being made executable?

If I edit an executable script, say foo.sh, then upon saving emacs makes the backup file foo.sh~. That's all well and good, but if the original file has the executable bit set, then so does the backup....
greatBigDot's user avatar
2 votes
1 answer
1k views

Delete auto-save file when killing Emacs without saving buffer

When I have unsaved buffers and I kill Emacs with save-buffers-kill-terminal (C-x C-c) I'm asked whether to save each buffer. Is it possible to delete a buffer's auto-save data when I answer n? I had ...
Arch Stanton's user avatar
  • 1,657
2 votes
0 answers
1k views

auto-save is unreliable

I almost never manually save files; I rely on auto-save. In the past few months I have noticed some of my edits mysteriously disappearing. The disappearances seem to be related to Linux crashes (...
wolfv's user avatar
  • 1,393
4 votes
2 answers
579 views

Save an org-mode buffer when I clock in/out of a task

I'm using the clocking functionality quite extensively, and I built a number of tools (outside of Emacs) that will look for clocked-in tasks. The problem is that these tools will parse the file on ...
cdecker's user avatar
  • 143
4 votes
1 answer
198 views

autosave on shell buffers

How can I set things up so the buffer being used to run an inferior shell will be autosaved periodically to a file? The file to save in could be named "shell-2018-01-22". I thought this would be ...
pedz's user avatar
  • 375
0 votes
1 answer
568 views

Tutorial Exercise - C-x C-s Save -- Write Protected issue in OSX

I'm making my way through the tutorial and have run into an issue when trying to do the exercise on saving a file: Saving file /~TUTORIAL... basic-save-buffer-2: Directory / write-protected Auto-...
innumeratus's user avatar
0 votes
0 answers
42 views

Temporarily save modified buffers

I would like to achieve the following workflow: When I open files to edit and close emacs, I want this changed files to be temporarily saved, so that I can very quickly close Emacs / move to other ...
JohnDoe's user avatar
  • 203
7 votes
1 answer
1k views

Keep auto-save files out of directory

I found different solutions for keeping auto-save files out of the directory where the original file is located on the internet, including (defconst emacs-tmp-dir (format "%s/%s%s/" "/t" "emacs" (...
UTF-8's user avatar
  • 915
1 vote
2 answers
545 views

How to set auto-save and backup path as subdirectory sibling of a given open file?

I am aware of How to place all auto-save files in a directory, but I cannot figure it out from Emacs manual how to save all auto-save versions and all backup copies of a given file in a subdirectory ...
gsl's user avatar
  • 1,772