aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-11-09 21:46:35 +0000
committerRichard M. Stallman1996-11-09 21:46:35 +0000
commit2ec9c94e21e908bd2d7825aa13b1a4664a07aa3b (patch)
treea4b9940b2fb6e37c27763a034948a9de4806c0fc
parentc2c5ed2c10a2f6115c596206a02cbee0a28be23f (diff)
downloademacs-2ec9c94e21e908bd2d7825aa13b1a4664a07aa3b.tar.gz
emacs-2ec9c94e21e908bd2d7825aa13b1a4664a07aa3b.zip
(combine-after-change-calls): New macro.
-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'."
783 (prog1 783 (prog1
784 (buffer-string) 784 (buffer-string)
785 (kill-buffer nil))))) 785 (kill-buffer nil)))))
786
787(defmacro combine-after-change-calls (&rest body)
788 "Execute BODY, but don't call the after-change functions till the end.
789If BODY makes changes in the buffer, they are recorded
790and the functions on `after-change-functions' are called several times
791when BODY is finished.
792The return value is rthe value of the last form in BODY.
793
794If `before-change-functions' is non-nil, then calls to the after-change
795functions can't be deferred, so in that case this macro has no effect.
796
797Do not alter `after-change-functions' or `before-change-functions'
798in BODY."
799 `(unwind-protect
800 (let ((combine-after-change-calls t))
801 . ,body)
802 (combine-after-change-execute)))
803
786 804
787(defvar save-match-data-internal) 805(defvar save-match-data-internal)
788 806