summaryrefslogtreecommitdiff
path: root/lisp/userlock.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-27 04:00:58 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-27 04:00:58 +0200
commitcc5b6cb6bcc63d447663e1e98b05b7a16bd27f99 (patch)
tree429082076c2578997164c1746a556691a2b4c512 /lisp/userlock.el
parent8567ec8bcfce39d4678ac016b00176ae9d5f3bd2 (diff)
downloademacs-cc5b6cb6bcc63d447663e1e98b05b7a16bd27f99.tar.gz
Fix backtrace when query-about-changed-file nil and file has changed
* lisp/userlock.el (userlock--check-content-unchanged): Make the assertion more robust -- we may be called here from a different contexts if `query-about-changed-file' is nil.
Diffstat (limited to 'lisp/userlock.el')
-rw-r--r--lisp/userlock.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/userlock.el b/lisp/userlock.el
index 38aaf6aec23..a38f6ac4222 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).