Questions tagged [backup]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
57 views

How does emacs write files?

When Emacs saves a file (save-buffer, write-file etc.), does it overwrite files directly or does it create a temporary file first? More specifically, if I edit /path-to/file.txt, will Emacs directly ...
0
votes
0answers
38 views

recover org file

I use emacs org mode + EVIL on MacOS. I had a small part of my file visually selected last night when I wrote :wq and hit y to the prompt. To my shock and horror this morning only the visually ...
3
votes
1answer
119 views

How can I back up my init file with Git?

The docs say to keep the .emacs file in the HOME directory. I'd like to share the file between multiple computers using a git repo. What is the best way to structure the repo without including ...
0
votes
0answers
21 views

Numbered backups not being created after every save

I would like for a new numbered backup file to be created every time I save a buffer. I.e. if I save a buffer ten times I want ten new backup files created. To that end I have added the code below in ...
4
votes
1answer
55 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-...
1
vote
1answer
181 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 `((".*"...
4
votes
3answers
174 views

How to ignore backup files (~) when running grep?

M-x grep can be used to find strings in files. But I'm not interested in backup files (those whose name ends with a ~). How should I ignore those files when using the grep command?
1
vote
2answers
66 views

I can't backup some orgmode files

I'm in a strange situation. Emacs automatically backup all of my files except for some of my orgmode files. And I can't understand why. Do you have any idea how I can investigate and fix this?
0
votes
1answer
31 views

I restored my MacOS machine from a backup. How to fix errors while trying to read/write non existing files in the /var/folders/ directory?

I restored my machine from a backup where I hadn't backed up system directories. Now my restored emacs (spacemacs) insist on trying to read and write from this directory and I keep on getting errors ...
1
vote
0answers
22 views

automatically backup before revert

I would like to backup buffers before they are (auto) reverted. This is nontrivial because the file a buffer is visiting isn't current, and the backup system normally works by duplicating the file ...
3
votes
1answer
77 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....
0
votes
1answer
80 views

Set variable not been read from .emacs

I've set some variables (kept-new-versions, for one) to a higher number (10, it was 2) since I don't mind having a handful of backup files in my dir. I did it using C-h v and customizing the variable....
1
vote
1answer
129 views

Prevent creation of backup org file

Whenever I create an Org file, a ~ backup file is created. How can I prevent this behaviour?
1
vote
1answer
65 views

Disable auto-backup only for certain files

As of How to stop auto backup in some directory in Emacs, it's possible to configure emacs to backup conditionally. Is there an option to set inside the file, in the first line, to disable backup for ...
1
vote
2answers
158 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 ...
3
votes
1answer
319 views

How can I tell Helm's `completion-at-point` to ignore certain file endings?

When I'm using emacs-shell, I often try to run files for which a backup (with ~ ending) exists. I use Helm, and if I try to auto-complete the name of a file called, say, seed-rand.rb, with an ...
1
vote
1answer
107 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 ...
4
votes
2answers
842 views

recover backup files

Is there a command for recover the current file from the backup ? I have a file ~/temp.txt and some backup files !home!djangoliv!temp.txt.~1~ ... !home!djangoliv!temp.txt.~5~, !home!djangoliv!temp....
1
vote
2answers
258 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 ...
3
votes
0answers
84 views

Why is renaming (rather than copying) the default way to create backup files?

The documentation on backup file creation, Copying vs. Renaming, makes it sound like copying is the more sensible choice. file owner and group remain unchanged hard links remain associated with the ...
4
votes
1answer
146 views

How to stop auto backup in some directory in Emacs

In general I want Emacs to save a backup file for me, except in some special directories. I tried to define a Directory Local Variables, and add: ((nil . ((make-backup-files . nil)))) But it seem ...
2
votes
1answer
474 views

Spacemacs/org-mode with nvAlt: disabling numbered backups

I'm fairly new to spacemacs/emacs, so apologies if this is a trivial question. I'm using org-mode for my notes, stored within nvAlt. This works wonderfully in terms of searching/syncing, however ...
2
votes
0answers
40 views

Keeping multiple back-ups

The below settings in my .emacs make emacs (24.3) save multiple back-ups. (setq delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t) However, I have ...
0
votes
1answer
66 views

How to save a file in place even with backups?

In order to prevent NFS caching from leading to stale files, I need to preserve the inode of a file when Emacs saves it. Normally, it does so anyway, but apparently not if backup files come into play....
6
votes
1answer
288 views

version control using the usual backup system of Emacs

This question is inspired by https://emacs.stackexchange.com/a/7831/ and the below settings borrowed from that answer : (setq backup-directory-alist '(("." . "~/emacs-backups")) version-control ...
14
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 ...
4
votes
2answers
438 views

Backup saved buffers to Dropbox (or other specific directory)

Is it possible to customize Emacs so that whenever I save a file, Emacs also copies it to a specific folder? This directory could be, for instance, D:\my_backups or C:\Users\username\Dropbox\...
10
votes
1answer
605 views

Turn off automatic backups for specific files

For a long time I've had Emacs put backups for all files into a single folder: (setq backup-directory-alist '(("." . "~/.emacs.d/backups"))) I hardly ever visit the backups directory, but recently I ...
9
votes
3answers
320 views

Automatic deletion of backup files

When editing files, some foo.bar~ backups appear (files ending with a tilde ~). How can I control their creations, and is it possible to ask for a recursive bulk deletion of all files from a ...
14
votes
4answers
4k views

Put all backups into one backup folder

How can I set up Emacs so that all backups are placed into one backup folder? e.g. /MyEmacsBackups