Mercurial > emacs
comparison lispref/text.texi @ 19467:d76f57ca7aba
Explain after-change-functions and chars vs bytes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 22 Aug 1997 05:58:17 +0000 |
parents | 7def48db254a |
children | 66d807bdc5b4 |
comparison
equal
deleted
inserted
replaced
19466:3fce1e7c0fd0 | 19467:d76f57ca7aba |
---|---|
2971 | 2971 |
2972 @defvar after-change-functions | 2972 @defvar after-change-functions |
2973 This variable holds a list of a functions to call after any buffer | 2973 This variable holds a list of a functions to call after any buffer |
2974 modification. Each function receives three arguments: the beginning and | 2974 modification. Each function receives three arguments: the beginning and |
2975 end of the region just changed, and the length of the text that existed | 2975 end of the region just changed, and the length of the text that existed |
2976 before the change. (To get the current length, subtract the region | 2976 before the change. All three arguments are integers. The buffer that's |
2977 beginning from the region end.) All three arguments are integers. The | 2977 about to change is always the current buffer. |
2978 buffer that's about to change is always the current buffer. | 2978 |
2979 The length of the old text is measured in bytes; it is the difference | |
2980 between the buffer positions before and after that text, before the | |
2981 change. As for the changed text, its length in bytes is simply the | |
2982 difference between the first two arguments. If you want the length | |
2983 in @emph{characters} of the text before the change, you should use | |
2984 a @code{before-change-functions} function that calls @code{chars-in-region} | |
2985 (@pxref{Chars and Bytes}). | |
2979 @end defvar | 2986 @end defvar |
2980 | 2987 |
2981 @defvar before-change-function | 2988 @defvar before-change-function |
2982 This obsolete variable holds one function to call before any buffer | 2989 This obsolete variable holds one function to call before any buffer |
2983 modification (or @code{nil} for no function). It is called just like | 2990 modification (or @code{nil} for no function). It is called just like |