]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix combine-change-calls-1 for when buffer-undo-list is t
authorAlan Mackenzie <acm@muc.de>
Wed, 4 Mar 2020 19:50:38 +0000 (19:50 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 4 Mar 2020 19:50:38 +0000 (19:50 +0000)
* lisp/subr.c (combine-change-calls-1): Bind before/after-change-functions to
nil also when buffer-undo-list is t.

lisp/subr.el

index c1c4cad18d1d186abcd6837ddd72c187369499a1..5b94343e499840fac199305a7f63124f02e09631 100644 (file)
@@ -3959,19 +3959,18 @@ the function `undo--wrap-and-run-primitive-undo'."
       (let ((undo--combining-change-calls t))
        (if (not inhibit-modification-hooks)
            (run-hook-with-args 'before-change-functions beg end))
-       (if (eq buffer-undo-list t)
-           (setq result (funcall body))
-         (let (;; (inhibit-modification-hooks t)
-                (before-change-functions
-                 ;; Ugly Hack: if the body uses syntax-ppss/syntax-propertize
-                 ;; (e.g. via a regexp-search or sexp-movement trigerring
-                 ;; on-the-fly syntax-propertize), make sure that this gets
-                 ;; properly refreshed after subsequent changes.
-                 (if (memq #'syntax-ppss-flush-cache before-change-functions)
-                     '(syntax-ppss-flush-cache)))
-                after-change-functions)
-           (setq result (funcall body)))
-         (let ((ap-elt
+       (let (;; (inhibit-modification-hooks t)
+              (before-change-functions
+               ;; Ugly Hack: if the body uses syntax-ppss/syntax-propertize
+               ;; (e.g. via a regexp-search or sexp-movement trigerring
+               ;; on-the-fly syntax-propertize), make sure that this gets
+               ;; properly refreshed after subsequent changes.
+               (if (memq #'syntax-ppss-flush-cache before-change-functions)
+                   '(syntax-ppss-flush-cache)))
+              after-change-functions)
+         (setq result (funcall body)))
+        (when (not (eq buffer-undo-list t))
+          (let ((ap-elt
                 (list 'apply
                       (- end end-marker)
                       beg