]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/subr.el (combine-change-calls-1): Fix bug#60467
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 13 Jan 2023 22:41:37 +0000 (17:41 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 13 Jan 2023 22:41:37 +0000 (17:41 -0500)
Don't stop at timestamps.
Also Don't burp about breakage just because (cdr old-bul) is nil.

lisp/subr.el

index d1d3c76caf8c8ff07c676a0025e8a71551d0ab3f..9e50b1e7f9183f7e4ffb658859e23288dcf489c8 100644 (file)
@@ -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)))))