diff options
| author | Eli Zaretskii | 2016-08-09 19:52:50 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-08-09 19:52:50 +0300 |
| commit | f785ff45d56b40f744a3d7138231d23dfd35dda4 (patch) | |
| tree | faa0aa796be882e666f4f04af70bc16eba8b9cce | |
| parent | 3c9cb57c6fae57d3798298faecccd0402b4ddd9a (diff) | |
| download | emacs-f785ff45d56b40f744a3d7138231d23dfd35dda4.tar.gz emacs-f785ff45d56b40f744a3d7138231d23dfd35dda4.zip | |
Clarify documentation of before/after-change-functions
* doc/lispref/text.texi (Change Hooks): Clarify that the hooks are
not called in balanced pairs.
| -rw-r--r-- | doc/lispref/text.texi | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 7791c261e3b..de0b00758a5 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -4676,10 +4676,10 @@ group you start for any given buffer should be the last one finished. | |||
| 4676 | @cindex change hooks | 4676 | @cindex change hooks |
| 4677 | @cindex hooks for text changes | 4677 | @cindex hooks for text changes |
| 4678 | 4678 | ||
| 4679 | These hook variables let you arrange to take notice of all changes in | 4679 | These hook variables let you arrange to take notice of changes in |
| 4680 | all buffers (or in a particular buffer, if you make them buffer-local). | 4680 | buffers (or in a particular buffer, if you make them buffer-local). |
| 4681 | See also @ref{Special Properties}, for how to detect changes to specific | 4681 | See also @ref{Special Properties}, for how to detect changes to |
| 4682 | parts of the text. | 4682 | specific parts of the text. |
| 4683 | 4683 | ||
| 4684 | The functions you use in these hooks should save and restore the match | 4684 | The functions you use in these hooks should save and restore the match |
| 4685 | data if they do anything that uses regular expressions; otherwise, they | 4685 | data if they do anything that uses regular expressions; otherwise, they |
| @@ -4687,8 +4687,8 @@ will interfere in bizarre ways with the editing operations that call | |||
| 4687 | them. | 4687 | them. |
| 4688 | 4688 | ||
| 4689 | @defvar before-change-functions | 4689 | @defvar before-change-functions |
| 4690 | This variable holds a list of functions to call before any buffer | 4690 | This variable holds a list of functions to call before most buffer |
| 4691 | modification. Each function gets two arguments, the beginning and end | 4691 | modifications. Each function gets two arguments, the beginning and end |
| 4692 | of the region that is about to change, represented as integers. The | 4692 | of the region that is about to change, represented as integers. The |
| 4693 | buffer that is about to change is always the current buffer. | 4693 | buffer that is about to change is always the current buffer. |
| 4694 | @end defvar | 4694 | @end defvar |
| @@ -4706,8 +4706,15 @@ for the changed text, its length is simply the difference between the | |||
| 4706 | first two arguments. | 4706 | first two arguments. |
| 4707 | @end defvar | 4707 | @end defvar |
| 4708 | 4708 | ||
| 4709 | Output of messages into the @file{*Messages*} buffer does not | 4709 | Output of messages into the @file{*Messages*} buffer does not call |
| 4710 | call these functions. | 4710 | these functions, and neither do certain internal buffer changes, such |
| 4711 | as changes in buffers created by Emacs internally for certain jobs, | ||
| 4712 | that should not be visible to Lisp programs. | ||
| 4713 | |||
| 4714 | Do @emph{not} expect the before-change hooks and the after-change | ||
| 4715 | hooks be called in balanced pairs around each buffer change. These | ||
| 4716 | hooks are provided on the assumption that Lisp programs will use | ||
| 4717 | either before- or the after-change hooks, but not both. | ||
| 4711 | 4718 | ||
| 4712 | @defmac combine-after-change-calls body@dots{} | 4719 | @defmac combine-after-change-calls body@dots{} |
| 4713 | The macro executes @var{body} normally, but arranges to call the | 4720 | The macro executes @var{body} normally, but arranges to call the |