]> git.eshelyaron.com Git - emacs.git/commitdiff
(backup-buffer): If the file's directory is not writable,
authorEli Zaretskii <eliz@gnu.org>
Sat, 19 Mar 2005 13:30:10 +0000 (13:30 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 19 Mar 2005 13:30:10 +0000 (13:30 +0000)
use copy instead of move to backup the file.

lisp/ChangeLog
lisp/files.el

index be934154ad64b3cc35f1a4a3acaaf38a31bcbe66..9d75a25f9e93e9fa56f7b73b8c47caa32f334bf3 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-19  JUAN-LEON Lahoz Garcia  <juanleon1@gmail.com>
+
+       * files.el (backup-buffer): If the file's directory is not
+       writable, use copy instead of move to backup the file.
+
 2005-03-19  Eli Zaretskii  <eliz@gnu.org>
 
        * obsolete/keyswap.el: Moved to obsolete/ from term/.
index ebd4d469f5c4d9bd5ab5cb131f08e76b960f11e3..68a1d52a2df02f2ec26c85e120cdec0d577937c9 100644 (file)
@@ -2687,6 +2687,7 @@ BACKUPNAME is the backup file name, which is the old file renamed."
                              backup-by-copying
                              ;; Don't rename a suid or sgid file.
                              (and modes (< 0 (logand modes #o6000)))
+                             (not (file-writable-p (file-name-directory real-file-name)))
                              (and backup-by-copying-when-linked
                                   (> (file-nlinks real-file-name) 1))
                              (and (or backup-by-copying-when-mismatch