changeset 71370:a8804de7b167

(basic-save-buffer-2): For a new precious file, use the default modes in the return value.
author Richard M. Stallman <rms@gnu.org>
date Fri, 16 Jun 2006 15:14:40 +0000
parents 71f07d141fe2
children a5f28e1a3fa6
files lisp/files.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Fri Jun 16 15:13:21 2006 +0000
+++ b/lisp/files.el	Fri Jun 16 15:14:40 2006 +0000
@@ -3630,8 +3630,9 @@
 		(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))