From: Stefan Monnier Date: Fri, 13 Jan 2023 22:41:37 +0000 (-0500) Subject: * lisp/subr.el (combine-change-calls-1): Fix bug#60467 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=977630b5285809a57e50ff5f38d9c34247b549a7;p=emacs.git * lisp/subr.el (combine-change-calls-1): Fix bug#60467 Don't stop at timestamps. Also Don't burp about breakage just because (cdr old-bul) is nil. --- diff --git a/lisp/subr.el b/lisp/subr.el index d1d3c76caf8..9e50b1e7f91 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4966,21 +4966,20 @@ the function `undo--wrap-and-run-primitive-undo'." beg (marker-position end-marker) #'undo--wrap-and-run-primitive-undo - beg (marker-position end-marker) buffer-undo-list)) + beg (marker-position end-marker) + ;; We will truncate this list by side-effect below. + buffer-undo-list)) (ptr buffer-undo-list)) (if (not (eq buffer-undo-list old-bul)) (progn (while (and (not (eq (cdr ptr) old-bul)) ;; In case garbage collection has removed OLD-BUL. - (cdr ptr) - ;; Don't include a timestamp entry. - (not (and (consp (cdr ptr)) - (consp (cadr ptr)) - (eq (caadr ptr) t) - (setq old-bul (cdr ptr))))) + (or (cdr ptr) + (progn + (message "combine-change-calls: buffer-undo-list broken") + nil))) (setq ptr (cdr ptr))) - (unless (cdr ptr) - (message "combine-change-calls: buffer-undo-list broken")) + ;; Truncate the list that's in the `apply' entry. (setcdr ptr nil) (push ap-elt buffer-undo-list) (setcdr buffer-undo-list old-bul)))))