Commit b024d9f0 authored by Mark Diekhans's avatar Mark Diekhans Committed by Chong Yidong

Make last-resort backup file in .emacs.d (Bug#6953).

* lisp/files.el (backup-buffer): Make last-resort backup file in
.emacs.d.

* lisp/subr.el (locate-user-emacs-file): If .emacs.d does not exist,
make it with permission 700.

* doc/emacs/files.texi (Backup Names): Document the new location of the
last-resort backup file.
parent 66399c0a
2011-01-15 Chong Yidong <cyd@stupidchicken.com>
* files.texi (Backup Names): Document the new location of the
last-resort backup file.
2011-01-08 Chong Yidong <cyd@stupidchicken.com>
* files.texi (File Aliases): Move directory-abbrev-alist doc from Lisp
......
......@@ -566,10 +566,10 @@ another from the newly saved contents if you save again.
appending @samp{~} to the file name being edited; thus, the backup
file for @file{eval.c} would be @file{eval.c~}.
If access control stops Emacs from writing backup files under the usual
names, it writes the backup file as @file{%backup%~} in your home
directory. Only one such file can exist, so only the most recently
made such backup is available.
If access control stops Emacs from writing backup files under the
usual names, it writes the backup file as @file{~/.emacs.d/%backup%~}.
Only one such file can exist, so only the most recently made such
backup is available.
Emacs can also make @dfn{numbered backup files}. Numbered backup
file names contain @samp{.~}, the number, and another @samp{~} after
......
......@@ -26,6 +26,10 @@ used on x86-64 and s390x GNU/Linux architectures.
* Changes in Emacs 23.3
+++
** The last-resort backup file `%backup%~' is now written to
`user-emacs-directory', instead of the user's home directory.
* Editing Changes in Emacs 23.3
......
2011-01-15 Mark Diekhans <markd@soe.ucsc.edu>
* files.el (backup-buffer): Make last-resort backup file in
.emacs.d (Bug#6953).
* subr.el (locate-user-emacs-file): If .emacs.d does not exist,
make it with permission 700.
2011-01-14 Kenichi Handa <handa@m17n.org>
* mail/rmailmm.el (rmail-mime-insert-header): Set
......
......@@ -3683,10 +3683,9 @@ BACKUPNAME is the backup file name, which is the old file renamed."
(rename-file real-file-name backupname t)
(setq setmodes (cons modes backupname)))
(file-error
;; If trouble writing the backup, write it in ~.
(setq backupname (expand-file-name
(convert-standard-filename
"~/%backup%~")))
;; If trouble writing the backup, write it in
;; .emacs.d/%backup%.
(setq backupname (locate-user-emacs-file "%backup%~"))
(message "Cannot write backup file; backing up in %s"
backupname)
(sleep-for 1)
......
......@@ -2340,11 +2340,16 @@ directory if it does not exist."
;; unless we're in batch mode or dumping Emacs
(or noninteractive
purify-flag
(file-accessible-directory-p (directory-file-name user-emacs-directory))
(make-directory user-emacs-directory))
(file-accessible-directory-p
(directory-file-name user-emacs-directory))
(let ((umask (default-file-modes)))
(unwind-protect
(progn
(set-default-file-modes ?\700)
(make-directory user-emacs-directory))
(set-default-file-modes umask))))
(abbreviate-file-name
(expand-file-name new-name user-emacs-directory))))))
;;;; Misc. useful functions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment