summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-11-09 21:46:35 +0000
committerRichard M. Stallman <rms@gnu.org>1996-11-09 21:46:35 +0000
commit8cb168c142a82d9e6117146eb16d4297024e6db1 (patch)
tree50b5cb9782a0239d6dbc0b6bc9db9ad383ad03e4 /lisp
parent8a54392178a7506a124d8f455e44fcd8a1a87852 (diff)
downloademacs-8cb168c142a82d9e6117146eb16d4297024e6db1.tar.gz
(combine-after-change-calls): New macro.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/subr.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 83cc198040d..0634ce21be7 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -783,6 +783,24 @@ See also `with-temp-file' and `with-output-to-string'."
(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)