# HG changeset patch # User Richard M. Stallman # Date 847575995 0 # Node ID 30ddd0e52ace0489052e811ed684d4a0b98cbba6 # Parent 12915fed5a02f451cc5585e9b6167f9d9b694ce0 (combine-after-change-calls): New macro. diff -r 12915fed5a02 -r 30ddd0e52ace lisp/subr.el --- a/lisp/subr.el Sat Nov 09 21:36:20 1996 +0000 +++ b/lisp/subr.el Sat Nov 09 21:46:35 1996 +0000 @@ -783,6 +783,24 @@ (prog1 (buffer-string) (kill-buffer nil))))) + +(defmacro combine-after-change-calls (&rest body) + "Execute BODY, but don't call the after-change functions till the end. +If BODY makes changes in the buffer, they are recorded +and the functions on `after-change-functions' are called several times +when BODY is finished. +The return value is rthe value of the last form in BODY. + +If `before-change-functions' is non-nil, then calls to the after-change +functions can't be deferred, so in that case this macro has no effect. + +Do not alter `after-change-functions' or `before-change-functions' +in BODY." + `(unwind-protect + (let ((combine-after-change-calls t)) + . ,body) + (combine-after-change-execute))) + (defvar save-match-data-internal)