Questions tagged [backup]

The tag has no usage guidance.

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

File permissions of backup files

Emacs (26.1) is putting highly restrictive permissions on backup files. This is causing a problem where multiple people are editing the same files. Here's an example: I created a file called test....
William Thompson's user avatar
0 votes
2 answers
34 views

Disable lsp-mode for certain buffers matching a specific pattern

What's the preferred way to not enter lsp-mode for certain buffers such as Emacs' backup files named for instance, app.c.~304fb1fe3650a354c4da16352f6c7be8bffd88cb~. I still want such files to open in ...
Nordlöw's user avatar
  • 497
1 vote
1 answer
273 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
43 views

Mac restart loses buffer state silently

I installed 28.2 on Monterey via Homebrew (as a cask). I have desktop-save-mode set; auto-save-* options are all default. Recently, I restarted the computer for updates; apparently I had somehow not ...
Nathan Tuggy's user avatar
0 votes
1 answer
104 views

How can I restore an org file from a backup?

I recently made the mistake of accidently deleting a portion of my home folder. I lost some org-documents for notes and things that I'd like to recover. Luckily, my .emacs.d directory and the backups ...
user432111's user avatar
2 votes
1 answer
58 views

Create versioned backup file on every save into date hierachy

New to Emacs and Lisp. I'm trying to replicate BBEdit's automatic backups, that is: create a subfolder for each day (2022-11-02) include the date and time in the backup's filename (2022-11-02 21-45-...
Pete's user avatar
  • 31
1 vote
1 answer
385 views

Modifying local Google Drive files from Emacs

Recently I've moved from MS Windows to Linux Mint. While on windows, I used to have a code of backup in my init.el file, so that all emacs backups were saved into my local folder DRIVE, that was ...
Rhythmical Diphthong's user avatar
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
0 votes
0 answers
116 views

Disable emacs from backingup file in a specified directory

Is it possible to stop emacs from backing up file in a directory? I have a directory that I use for documenting changes I made to the computer. The files in it are small but I need to make 1 everyday ...
Dick A's user avatar
  • 1
0 votes
0 answers
111 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
2 votes
1 answer
281 views

Emacs backups - why backup all files to a single directory?

I was updating my emacs backup approach using ideas from answers to this question, but I'm left unsure by one aspect, namely: the fact that several of them arrange to have backups placed in a single ...
tkp's user avatar
  • 153
0 votes
1 answer
33 views

How to prevent backup for files larger than 3MB?

One of the emacs's nice features is Backup. But is there any way to prevent backup for files larger than 3MB? Thanks!
Samira's user avatar
  • 1
0 votes
1 answer
115 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
0 answers
116 views

How can I make Emacs back up files right after they are saved?

I have followed this answer's solution. My goal is to back up files right after I save them. When I create a new file it is successfully backed up to the given path, but when I close and re-open Emacs ...
alper's user avatar
  • 1,350
1 vote
1 answer
165 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
297 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
169 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 ...
kdb's user avatar
  • 1,561
3 votes
1 answer
667 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 ...
Hugh_Kelley's user avatar
4 votes
1 answer
799 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,393
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
3 votes
3 answers
747 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?
DataHungry's user avatar
1 vote
2 answers
161 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?
Rene's user avatar
  • 89
0 votes
1 answer
52 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 ...
loxs's user avatar
  • 153
1 vote
0 answers
31 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 ...
PythonNut's user avatar
  • 10.4k
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
0 votes
1 answer
154 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....
Quora Feans's user avatar
1 vote
1 answer
283 views

Prevent creation of backup org file

Whenever I create an Org file, a ~ backup file is created. How can I prevent this behaviour?
Vaibhav's user avatar
  • 583
1 vote
1 answer
194 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 ...
serv-inc's user avatar
  • 818
1 vote
2 answers
538 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
4 votes
2 answers
2k 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....
djangoliv's user avatar
  • 3,189
1 vote
2 answers
773 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 ...
Stand with Gaza's user avatar
4 votes
0 answers
218 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 ...
ivan's user avatar
  • 1,948
4 votes
1 answer
1k 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 ...
David S.'s user avatar
  • 395
2 votes
1 answer
563 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 ...
gregoltsov's user avatar
2 votes
0 answers
52 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 ...
P. Ajrem's user avatar
  • 141
0 votes
1 answer
90 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....
Torsten Bronger's user avatar
6 votes
1 answer
472 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 ...
Name's user avatar
  • 7,829
4 votes
2 answers
635 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\...
Name's user avatar
  • 7,829
12 votes
2 answers
1k 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 ...
itsjeyd's user avatar
  • 14.7k
9 votes
3 answers
1k 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 ...
smonff's user avatar
  • 1,579
22 votes
3 answers
12k 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
programking's user avatar
  • 7,164