summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-06-16 15:14:40 +0000
committerRichard M. Stallman <rms@gnu.org>2006-06-16 15:14:40 +0000
commit730df8dbd56435eaf68d4ba29504a31e746c6ce3 (patch)
tree444bbd521a0d99b962d77b84e9bfe9c61788eea2 /lisp
parenta926c9ceedba01b3e90905f25b98ef16895a701b (diff)
downloademacs-730df8dbd56435eaf68d4ba29504a31e746c6ce3.tar.gz
(basic-save-buffer-2): For a new precious file,
use the default modes in the return value.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 91f857dd2ec..3313f003d89 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3630,8 +3630,9 @@ Before and after saving the buffer, this function runs
(set-visited-file-modtime old-modtime)))
;; Since we have created an entirely new file,
;; make sure it gets the right permission bits set.
- (setq setmodes (or setmodes (cons (file-modes buffer-file-name)
- buffer-file-name)))
+ (setq setmodes (or setmodes
+ (cons (or (file-modes buffer-file-name) umask)
+ buffer-file-name)))
;; We succeeded in writing the temp file,
;; so rename it.
(rename-file tempname buffer-file-name t))