aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2005-03-19 13:30:10 +0000
committerEli Zaretskii2005-03-19 13:30:10 +0000
commit79d2d2796a1f902a5f14edec9b300c053923c230 (patch)
treebdd13e7bae84c13a852e3534536fdfe85d617cfe
parentf3b7338cc32de5be34c3564cf250ed242354be35 (diff)
downloademacs-79d2d2796a1f902a5f14edec9b300c053923c230.tar.gz
emacs-79d2d2796a1f902a5f14edec9b300c053923c230.zip
(backup-buffer): If the file's directory is not writable,
use copy instead of move to backup the file.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/files.el1
2 files changed, 6 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be934154ad6..9d75a25f9e9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12005-03-19 JUAN-LEON Lahoz Garcia <juanleon1@gmail.com>
2
3 * files.el (backup-buffer): If the file's directory is not
4 writable, use copy instead of move to backup the file.
5
12005-03-19 Eli Zaretskii <eliz@gnu.org> 62005-03-19 Eli Zaretskii <eliz@gnu.org>
2 7
3 * obsolete/keyswap.el: Moved to obsolete/ from term/. 8 * obsolete/keyswap.el: Moved to obsolete/ from term/.
diff --git a/lisp/files.el b/lisp/files.el
index ebd4d469f5c..68a1d52a2df 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2687,6 +2687,7 @@ BACKUPNAME is the backup file name, which is the old file renamed."
2687 backup-by-copying 2687 backup-by-copying
2688 ;; Don't rename a suid or sgid file. 2688 ;; Don't rename a suid or sgid file.
2689 (and modes (< 0 (logand modes #o6000))) 2689 (and modes (< 0 (logand modes #o6000)))
2690 (not (file-writable-p (file-name-directory real-file-name)))
2690 (and backup-by-copying-when-linked 2691 (and backup-by-copying-when-linked
2691 (> (file-nlinks real-file-name) 1)) 2692 (> (file-nlinks real-file-name) 1))
2692 (and (or backup-by-copying-when-mismatch 2693 (and (or backup-by-copying-when-mismatch