* doc/lispref/text.texi (Change Hooks): Minor copyedits.

This commit is contained in:
Eli Zaretskii 2016-08-10 20:12:55 +03:00
parent f785ff45d5
commit ccd0e92ecc

View file

@ -4687,18 +4687,20 @@ will interfere in bizarre ways with the editing operations that call
them. them.
@defvar before-change-functions @defvar before-change-functions
This variable holds a list of functions to call before most buffer This variable holds a list of functions to call when Emacs is about to
modifications. Each function gets two arguments, the beginning and end modify a buffer. Each function gets two arguments, the beginning and
of the region that is about to change, represented as integers. The end of the region that is about to change, represented as integers.
buffer that is about to change is always the current buffer. The buffer that is about to change is always the current buffer when
the function is called.
@end defvar @end defvar
@defvar after-change-functions @defvar after-change-functions
This variable holds a list of functions to call after any buffer This variable holds a list of functions to call after Emacs modifies a
modification. Each function receives three arguments: the beginning buffer. Each function receives three arguments: the beginning and end
and end of the region just changed, and the length of the text that of the region just changed, and the length of the text that existed
existed before the change. All three arguments are integers. The before the change. All three arguments are integers. The buffer that
buffer that has been changed is always the current buffer. has been changed is always the current buffer when the function is
called.
The length of the old text is the difference between the buffer The length of the old text is the difference between the buffer
positions before and after that text as it was before the change. As positions before and after that text as it was before the change. As
@ -4712,9 +4714,13 @@ as changes in buffers created by Emacs internally for certain jobs,
that should not be visible to Lisp programs. that should not be visible to Lisp programs.
Do @emph{not} expect the before-change hooks and the after-change Do @emph{not} expect the before-change hooks and the after-change
hooks be called in balanced pairs around each buffer change. These hooks be called in balanced pairs around each buffer change. Also
hooks are provided on the assumption that Lisp programs will use don't expect the before-change hooks to be called for every chunk of
either before- or the after-change hooks, but not both. text Emacs is about to delete. These hooks are provided on the
assumption that Lisp programs will use either before- or the
after-change hooks, but not both, and the boundaries of the region
where the changes happen might include more than just the actual
changed text, or even lump together several changes done piecemeal.
@defmac combine-after-change-calls body@dots{} @defmac combine-after-change-calls body@dots{}
The macro executes @var{body} normally, but arranges to call the The macro executes @var{body} normally, but arranges to call the