# HG changeset patch # User Richard M. Stallman # Date 780035260 0 # Node ID 065d01c10c78ea42d3e78f9ee88aaeec4705b591 # Parent bcf92490217e7d6b82d596439a8a550c2ab32464 (basic-save-buffer-1): If writing temp file fails or a precious file, restore the old visited file modtime. diff -r bcf92490217e -r 065d01c10c78 lisp/files.el --- a/lisp/files.el Tue Sep 20 04:27:27 1994 +0000 +++ b/lisp/files.el Tue Sep 20 04:27:40 1994 +0000 @@ -1668,7 +1668,8 @@ ;; This requires write access to the containing dir, ;; which is why we don't try it if we don't have that access. (let ((realname buffer-file-name) - tempname temp nogood i succeed) + tempname temp nogood i succeed + (old-modtime (visited-file-modtime))) (setq i 0) (setq nogood t) ;; Find the temporary name to write under. @@ -1683,7 +1684,10 @@ (setq succeed t)) ;; If writing the temp file fails, ;; delete the temp file. - (or succeed (delete-file tempname))) + (or succeed + (progn + (delete-file tempname) + (set-visited-file-modtime old-modtime)))) ;; Since we have created an entirely new file ;; and renamed it, make sure it gets the ;; right permission bits set.