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
1
vote
0answers
25 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 ...
0
votes
1answer
41 views

Control where auto-save file are placed

Trying to store all auto-save files in a single dir, i.e. ~/.emacs.d/autosave/ I have read the emacs manual on autosave I have read the emacs wiki on placing auto save file in one place From this ...
0
votes
1answer
104 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 ...
1
vote
0answers
27 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 ...
1
vote
1answer
22 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.
1
vote
2answers
54 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 # ...
1
vote
1answer
27 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.
1
vote
1answer
19 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 ...
0
votes
2answers
64 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 ...
4
votes
1answer
140 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-...
2
votes
2answers
225 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 ...
0
votes
0answers
55 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-...
0
votes
1answer
62 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. ...
1
vote
1answer
393 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 `((".*"...
1
vote
0answers
24 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 ...
3
votes
1answer
270 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 ...
3
votes
1answer
86 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....
2
votes
1answer
444 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 ...
2
votes
0answers
917 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 (...
2
votes
2answers
199 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 ...
4
votes
1answer
96 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 ...
0
votes
1answer
344 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-...
0
votes
0answers
34 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 ...
5
votes
1answer
643 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" (...
1
vote
2answers
220 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 ...
1
vote
1answer
109 views

What are the '.#' links for? [duplicate]

When an Emacs buffer is modified, a broken link is created. The link's name is a concatenation of '.#' followed by the file's name. For example: $ ls .#spacemacs_ref.org -l lrwxrwxrwx. 1 wolfv wolfv ...
1
vote
1answer
131 views

What are .#foo files?

I have placed my autosave and backup files in a single directory .emacs-saves. Backup files appear as ~foo Autosave files appear as #foo# But Emacs seems to also generate .#foo in the current ...
0
votes
1answer
54 views

Prevent creation of ~ files

Emacs keeps pooping out random .extension~ files that are messing up my program. How do I prevent creation of these files?
1
vote
2answers
311 views

Change naming scheme for backup files

I'm putting all my backups in a directory: (defvar saves-dir (expand-file-name "~/.saves/")) (setq backup-directory-alist `((".*" . ,saves-dir))) This creates annoying filenames with ! in them, such ...
0
votes
1answer
347 views

Certain org-mode buffers keep saving automatically

Certain org-mode buffers seem to write to file automatically when left idle even for a second. I've tried disabling a few minor modes but to no avail. It makes it all the more difficult to debug this ...
4
votes
2answers
872 views

How to autosave a buffer to the original file on disk?

I want Emacs to auto-save a buffer or buffers so that I don't have to press C-x C-s each time. With auto-save turned on, I see the label "Auto-saving.... Done", which appears once in 30 seconds or so....
3
votes
2answers
429 views

save a particular buffer without prompting on emacs exit?

I have a particular buffer that collects statistics from my emacs sessions. I could write the buffer every time I update the statistics, but that's not efficient. I want to auto-write the buffer ...
1
vote
1answer
77 views

How can I get Emacs to save the changes automatically each X seconds?

How can I setup Emacs >= 24.4 so that it saves at least the current file I'm working on automatically, say, each 5 seconds, so that I don't have to press C-x C-s each time to save my changes?
2
votes
1answer
143 views

Temporary Files Still Appearing in Current Dir

I have this in my .init.el file: (setq backup-directory-alist `((".*" . "~/.saves"))) (setq auto-save-file-name-transforms `((".*" "~/.saves" t))) Yet I am still getting random backup ...
6
votes
3answers
8k views

How to place all auto-save files in a directory

I would like to put all of my auto-save files into a directory, say something like ~/.emacs-saves Based on what's written in the wiki, I came up with this: (setq backup-by-copying t ; don't ...
4
votes
1answer
179 views

Invalid coding system: auto-save-coding when trying to recover auto-save files

Sometimes when I try to run recover-this-file I get an error Invalid coding system: auto-save-coding which prevents the file from being recovered. I had to manually find the autosave file and copy ...
8
votes
1answer
1k views

How to disable auto-save in emacs only for files opened as root

I want to use emacs auto-save feature with tramp, but only for file that I don't open using sudo. My current configuration, based on the tramp documentation, looks like this: ;;;;;;;; BAKUCP ;;;;;;;; ...
0
votes
0answers
16 views

Auto save is disabled but emacs is making files in the format .#file-name [duplicate]

I set auto save to nil after discovering this, but they keep popping up. Does anyone know what could be causing this? It's not the typical #filename#, it's making a dotfile .#
7
votes
1answer
485 views

Auto-save buffers that aren't visiting files

I often do something like: C-x b foobarbaz RET to get a new buffer for taking notes, etc. I'd love for emacs to just snapshot and dump all open buffers to disk occasionally. There's lots of ...
8
votes
1answer
414 views

Disable prompting to auto-recover when auto-save data is the same as file

When I kill emacs (with killall emacs from a shell prompt, for example), and I was editing a file, Emacs restarts with a message filename has auto save data; consider M-x recover-this-file If I ...
14
votes
4answers
615 views

Disabling the “Auto-saving…done” message

I want my documents to be auto-saved, but I don't want to be interrupted with the message "Auto-saving...done" every few minutes. Is there a way to just disable this message, but not the auto-saving ...
4
votes
0answers
157 views

how to get Emacs to stop saving org-agenda as a file?

In my directory I keep on winding up with dozens of files with names like these: #%2AOrg%20Agenda%2A#12182wk# #%2AOrg%20Agenda%2A#13353nN# #%2AOrg%20Agenda%2A#13568-1B# The content of which is this: ...
7
votes
3answers
1k views

Save buffer at each modification

I'd like to know if it is possible the buffer is saved at the exact moment of modification; at the instant of the key up event.
3
votes
1answer
168 views

Don't apply executable-make-buffer-file-executable-if-script-p to backup files

I currently have (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) in my config to automatically make scripts executable when saving them. However, I personally don'...
0
votes
1answer
433 views

Trying to save open buffers to file every n seconds in emacs, why does this solution not work?

I want to save all open buffers to the relevant files (not an autosave file) at some regular interval (between 5 and 1 minutes). This seemed like it was the correct solution: ; In ~/.emacs file ...
0
votes
1answer
122 views

Save file when switching buffers

How can I get emacs to save the buffer automatically every time I switch to another buffer? (This is similar to this question, where the buffer is saved automatically when Emacs loses focus.)
5
votes
2answers
551 views

untracked “.#file” in a git repository?

Q: where do untracked .#files come from when working in a git repository? When working on file example.txt in a git repository, I occasionally get an untracked file showing up in status titled .#...
4
votes
1answer
1k views

Autosave *scratch* to a directory

When typing ls in my home directory, I amm greeted by a lot of this: #%2Ascratch%2A#1399_po# #%2Ascratch%2A#14484YsZ# [...] I also have the following in my init.el (defvar autosave-location (concat ...
6
votes
2answers
1k views

Emacs doesn't let me exit without selecting a coding system

Sometimes to speed up of opening an emacs' eshell directly from terminal (in my case from MS DOS prompt), I do emacs -Q -f eshell. But when I try to exit emacs doesn't let it, unless I give some input ...
16
votes
1answer
1k views

Save lock-files to a directory instead of disabling them

Emacs 24 introduced the ability to disable the creation of the infamous .#file-name lock files. Evaluating the following lisp form will completely disable Emacs ability to lock files to prevent ...