Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
6782610c
Commit
6782610c
authored
Sep 20, 1994
by
Richard M. Stallman
Browse files
(basic-save-buffer-1): If writing temp file fails
or a precious file, restore the old visited file modtime.
parent
c56fbd24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lisp/files.el
lisp/files.el
+6
-2
No files found.
lisp/files.el
View file @
6782610c
...
...
@@ -1668,7 +1668,8 @@ the last real save, but optional arg FORCE non-nil means delete anyway."
;; 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 @@ the last real save, but optional arg FORCE non-nil means delete anyway."
(
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment