diff options
author | Jim Blandy <jimb@redhat.com> | 1993-03-11 07:04:44 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1993-03-11 07:04:44 +0000 |
commit | 8aca0905655466251f7db621b0418b6169973bd6 (patch) | |
tree | 49167adcaf7fa9181c8bfb3a9ed1b56b9abc975c /lisp | |
parent | d3270d8ca5a471da67886801f58c1b7c394bca6d (diff) | |
download | emacs-8aca0905655466251f7db621b0418b6169973bd6.tar.gz |
* files.el (basic-save-buffer): If file-precious-flag is set, and
we write the buffer to a temp file and then rename it, don't
neglect to set the new file's modes properly.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/files.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index 60329f162b2..88150a7133b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1279,6 +1279,10 @@ the last real save, but optional arg FORCE non-nil means delete anyway." ;; If writing the temp file fails, ;; delete the temp file. (or succeed (delete-file tempname))) + ;; Since we have created an entirely new file + ;; and renamed it, make sure it gets the + ;; right permission bits set. + (setq setmodes (file-modes buffer-file-name)) ;; We succeeded in writing the temp file, ;; so rename it. (rename-file tempname buffer-file-name t)) |