diff lisp/files.el @ 112266:704fa1a3d5b4

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.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 14 Jan 2011 21:32:19 -0500
parents fb129cb53476
children cc0887b67703
line wrap: on
line diff
--- a/lisp/files.el	Fri Jan 14 13:08:53 2011 +0900
+++ b/lisp/files.el	Fri Jan 14 21:32:19 2011 -0500
@@ -3683,10 +3683,9 @@
 			(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)