* lisp/subr.el (combine-change-calls-1): Fix bug#64989

Silence the spurious warning, and improve the warning while at it.
Do not merge to master.
This commit is contained in:
Stefan Monnier 2023-08-28 12:12:42 -04:00
parent 648a5e33e8
commit f26622b2a4

View file

@ -5002,8 +5002,8 @@ the function `undo--wrap-and-run-primitive-undo'."
;; Don't include a timestamp entry.
(setcdr ptr (cddr ptr))
(setq ptr (cdr ptr))))
(unless (cdr ptr)
(message "combine-change-calls: buffer-undo-list broken"))
(unless (or (cdr ptr) (null old-bul))
(message "combine-change-calls: buffer-undo-list presumably truncated by GC"))
(setcdr ptr nil)
(push ap-elt buffer-undo-list)
(setcdr buffer-undo-list old-bul)))))