Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
24 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
24 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
59 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
20 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 ...
2
votes
1answer
115 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
70 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
157 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 ...
1
vote
0answers
526 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 (...
1
vote
2answers
94 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
66 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
215 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
31 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
382 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
119 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
76 views

What are the '.#' links for?

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
88 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
51 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
201 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
243 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 ...
2
votes
2answers
501 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
304 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
59 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
112 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 ...
4
votes
3answers
5k 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
152 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
769 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
15 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
435 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 ...
7
votes
1answer
278 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 ...
12
votes
2answers
415 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
149 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: ...
6
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
137 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
347 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
89 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
448 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 .#...
3
votes
1answer
858 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 ...
5
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 ...
14
votes
1answer
891 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 ...
0
votes
1answer
143 views

Questions regarding auto-save

I have seen a lot of times that Emacs perform auto-save and I have some questions regarding it: What are the reasons for that? Where can I find the saved file? What are the advantages of having it ...