1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-13 17:40:22 -08:00

Fix combine-change-calls-1 for when buffer-undo-list is t

* lisp/subr.c (combine-change-calls-1): Bind before/after-change-functions to
nil also when buffer-undo-list is t.
This commit is contained in:
Alan Mackenzie 2020-03-04 19:50:38 +00:00
parent db37dd2e84
commit a1abf73c76

View file

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