Commit b411d947 authored by Jim Blandy's avatar Jim Blandy
Browse files

* 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.
parent ae39e667
......@@ -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))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment