Function: combine-change-calls
combine-change-calls is a macro defined in subr.el.gz.
Signature
(combine-change-calls BEG END &rest BODY)
Documentation
Evaluate BODY, running the change hooks just once.
BODY is a sequence of Lisp forms to evaluate. BEG and END bound the region the change hooks will be run for.
Firstly, before-change-functions is invoked for the region
(BEG END), then the BODY forms are evaluated with
before-change-functions and after-change-functions bound to
nil, and finally after-change-functions is invoked on the
updated region. The change hooks are not run if
inhibit-modification-hooks is initially non-nil.
The result of combine-change-calls is the value returned by the
last of the BODY forms to be evaluated. BODY may not make a
different buffer current, except temporarily. BODY may not
change the buffer outside the specified region. It must not
change before-change-functions or after-change-functions.
Additionally, the buffer modifications of BODY are recorded on
the buffer's undo list as a single (apply ...) entry containing
the function undo--wrap-and-run-primitive-undo.
Probably introduced at or before Emacs version 27.1.
Aliases
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro combine-change-calls (beg end &rest body)
"Evaluate BODY, running the change hooks just once.
BODY is a sequence of Lisp forms to evaluate. BEG and END bound
the region the change hooks will be run for.
Firstly, `before-change-functions' is invoked for the region
\(BEG END), then the BODY forms are evaluated with
`before-change-functions' and `after-change-functions' bound to
nil, and finally `after-change-functions' is invoked on the
updated region. The change hooks are not run if
`inhibit-modification-hooks' is initially non-nil.
The result of `combine-change-calls' is the value returned by the
last of the BODY forms to be evaluated. BODY may not make a
different buffer current, except temporarily. BODY may not
change the buffer outside the specified region. It must not
change `before-change-functions' or `after-change-functions'.
Additionally, the buffer modifications of BODY are recorded on
the buffer's undo list as a single \(apply ...) entry containing
the function `undo--wrap-and-run-primitive-undo'."
(declare (debug (form form def-body)) (indent 2))
`(combine-change-calls-1 ,beg ,end (lambda () ,@body)))