emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100379: Make last-resort backup f


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100379: Make last-resort backup file in .emacs.d (Bug#6953).
Date: Fri, 14 Jan 2011 21:32:19 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100379
author: Mark Diekhans <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Fri 2011-01-14 21:32:19 -0500
message:
  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.
modified:
  doc/emacs/ChangeLog
  doc/emacs/files.texi
  etc/NEWS
  lisp/ChangeLog
  lisp/files.el
  lisp/subr.el
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2011-01-08 22:01:13 +0000
+++ b/doc/emacs/ChangeLog       2011-01-15 02:32:19 +0000
@@ -1,3 +1,8 @@
+2011-01-15  Chong Yidong  <address@hidden>
+
+       * files.texi (Backup Names): Document the new location of the
+       last-resort backup file.
+
 2011-01-08  Chong Yidong  <address@hidden>
 
        * files.texi (File Aliases): Move directory-abbrev-alist doc from Lisp

=== modified file 'doc/emacs/files.texi'
--- a/doc/emacs/files.texi      2011-01-08 22:01:13 +0000
+++ b/doc/emacs/files.texi      2011-01-15 02:32:19 +0000
@@ -566,10 +566,10 @@
 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

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2011-01-02 23:50:46 +0000
+++ b/etc/NEWS  2011-01-15 02:32:19 +0000
@@ -26,6 +26,10 @@
 
 * 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
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-01-14 04:08:30 +0000
+++ b/lisp/ChangeLog    2011-01-15 02:32:19 +0000
@@ -1,3 +1,11 @@
+2011-01-15  Mark Diekhans  <address@hidden>
+
+       * 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  <address@hidden>
 
        * mail/rmailmm.el (rmail-mime-insert-header): Set

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2011-01-07 15:55:13 +0000
+++ b/lisp/files.el     2011-01-15 02:32:19 +0000
@@ -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)

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2011-01-13 05:12:01 +0000
+++ b/lisp/subr.el      2011-01-15 02:32:19 +0000
@@ -2340,11 +2340,16 @@
        ;; 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.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]