Fix time comparison in primitive-undo

* lisp/simple.el (primitive-undo): Fix time comparison.
The old code was a circa-2013 mistranslation of what used to be in
src/undo.c’s Fprimitive_undo.
This commit is contained in:
Paul Eggert 2022-08-01 00:38:34 -07:00
parent 4d896c0977
commit 72c3efd7d0

View file

@ -3543,10 +3543,7 @@ Return what remains of the list."
(setq visited-file-time
(with-current-buffer (buffer-base-buffer)
(visited-file-modtime))))
(when (or (equal time visited-file-time)
(and (consp time)
(equal (list (car time) (cdr time))
visited-file-time)))
(when (time-equal-p time visited-file-time)
(unlock-buffer)
(set-buffer-modified-p nil))))
;; Element (nil PROP VAL BEG . END) is property change.