diff options
| author | Jim Blandy | 1993-03-11 07:04:44 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-03-11 07:04:44 +0000 |
| commit | b411d947d8b06d3ef27a0e7956f83ae9a8136afe (patch) | |
| tree | 70e19274c9cef1a7cc6bb65c87f4ca28efe51e31 | |
| parent | ae39e6673d4afeaca482261c89118ebc82a1b167 (diff) | |
| download | emacs-b411d947d8b06d3ef27a0e7956f83ae9a8136afe.tar.gz emacs-b411d947d8b06d3ef27a0e7956f83ae9a8136afe.zip | |
* 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.
| -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." | |||
| 1279 | ;; If writing the temp file fails, | 1279 | ;; If writing the temp file fails, |
| 1280 | ;; delete the temp file. | 1280 | ;; delete the temp file. |
| 1281 | (or succeed (delete-file tempname))) | 1281 | (or succeed (delete-file tempname))) |
| 1282 | ;; Since we have created an entirely new file | ||
| 1283 | ;; and renamed it, make sure it gets the | ||
| 1284 | ;; right permission bits set. | ||
| 1285 | (setq setmodes (file-modes buffer-file-name)) | ||
| 1282 | ;; We succeeded in writing the temp file, | 1286 | ;; We succeeded in writing the temp file, |
| 1283 | ;; so rename it. | 1287 | ;; so rename it. |
| 1284 | (rename-file tempname buffer-file-name t)) | 1288 | (rename-file tempname buffer-file-name t)) |