[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lispref/text.texi,v [EMACS_22_BASE]
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lispref/text.texi,v [EMACS_22_BASE] |
Date: |
Tue, 21 Aug 2007 18:22:07 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Stefan Monnier <monnier> 07/08/21 18:22:04
Index: lispref/text.texi
===================================================================
RCS file: /sources/emacs/emacs/lispref/text.texi,v
retrieving revision 1.139.2.4
retrieving revision 1.139.2.5
diff -u -b -r1.139.2.4 -r1.139.2.5
--- lispref/text.texi 1 Jun 2007 02:05:39 -0000 1.139.2.4
+++ lispref/text.texi 21 Aug 2007 18:22:03 -0000 1.139.2.5
@@ -4364,35 +4364,6 @@
functions.
@end defmac
-The two variables above are temporarily bound to @code{nil} during the
-time that any of these functions is running. This means that if one of
-these functions changes the buffer, that change won't run these
-functions. If you do want a hook function to make changes that run
-these functions, make it bind these variables back to their usual
-values.
-
-One inconvenient result of this protective feature is that you cannot
-have a function in @code{after-change-functions} or
address@hidden which changes the value of that variable.
-But that's not a real limitation. If you want those functions to change
-the list of functions to run, simply add one fixed function to the hook,
-and code that function to look in another variable for other functions
-to call. Here is an example:
-
address@hidden
-(setq my-own-after-change-functions nil)
-(defun indirect-after-change-function (beg end len)
- (let ((list my-own-after-change-functions))
- (while list
- (funcall (car list) beg end len)
- (setq list (cdr list)))))
-
address@hidden
-(add-hooks 'after-change-functions
- 'indirect-after-change-function)
address@hidden group
address@hidden example
-
@defvar first-change-hook
This variable is a normal hook that is run whenever a buffer is changed
that was previously in the unmodified state.
@@ -4404,6 +4375,13 @@
described above in this section, as well as the hooks attached to
certain special text properties (@pxref{Special Properties}) and overlay
properties (@pxref{Overlay Properties}).
+
+Also, this variable is bound to address@hidden while running those
+same hook variables, so that by default modifying the buffer from
+a modification hook does not cause other modification hooks to be run.
+If you do want modification hooks to be run in a particular piece of
+code that is itself run from a modification hook, then rebind locally
address@hidden to @code{nil}.
@end defvar
@ignore
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lispref/text.texi,v [EMACS_22_BASE],
Stefan Monnier <=