diff options
Diffstat (limited to 'lisp/userlock.el')
-rw-r--r-- | lisp/userlock.el | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/lisp/userlock.el b/lisp/userlock.el index 38aaf6aec23..348ccc6f8ec 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el @@ -125,7 +125,8 @@ You can <%s>uit; don't modify this file." (with-demoted-errors "Unchanged content check: %S" ;; Even tho we receive `filename', we know that `filename' refers to the current ;; buffer's file. - (cl-assert (equal filename (expand-file-name buffer-file-truename))) + (cl-assert (equal (expand-file-name filename) + (expand-file-name buffer-file-truename))) ;; Note: rather than read the file and compare to the buffer, we could save ;; the buffer and compare to the file, but for encrypted data this ;; wouldn't work well (and would risk exposing the data). @@ -193,20 +194,19 @@ really edit the buffer? (%s, %s, %s or %s) " (list "File reverted" filename))) ((eq answer ?n) (signal 'file-supersession - (list "File changed on disk" filename))))) + (list "File changed on disk" filename))) + ((eq answer ?y)) + (t (setq answer nil)))) (message "File on disk now will become a backup file if you save these changes.") (setq buffer-backed-up nil)))) (defun ask-user-about-supersession-help () (with-output-to-temp-buffer "*Help*" - (let ((revert-buffer-binding - ;; This takes place in the original buffer. - (substitute-command-keys "\\[revert-buffer]"))) - (with-current-buffer standard-output - (insert - (format - "You want to modify a buffer whose disk file has changed + (with-current-buffer standard-output + (insert + (format + "You want to modify a buffer whose disk file has changed since you last read it in or saved it with this buffer. If you say %s to go ahead and modify this buffer, @@ -215,14 +215,13 @@ If you say %s to revert, the contents of the buffer are refreshed from the file on disk. If you say %s, the change you started to make will be aborted. -Usually, you should type %s and then %s, -to get the latest version of the file, then make the change again." - (userlock--fontify-key "y") - (userlock--fontify-key "r") - (userlock--fontify-key "n") - (userlock--fontify-key "n") - revert-buffer-binding)) - (help-mode))))) +Usually, you should type %s to get the latest version of the +file, then make the change again." + (userlock--fontify-key "y") + (userlock--fontify-key "r") + (userlock--fontify-key "n") + (userlock--fontify-key "r"))) + (help-mode)))) ;;;###autoload (defun userlock--handle-unlock-error (error) |