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:
parent
db37dd2e84
commit
a1abf73c76
1 changed files with 12 additions and 13 deletions
25
lisp/subr.el
25
lisp/subr.el
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue