diff options
| author | Richard M. Stallman | 1997-08-22 05:58:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-22 05:58:17 +0000 |
| commit | 584b81041669d040a23cd7cd9c73421c8b59d210 (patch) | |
| tree | 72a741c42a9bbe2fb718e979409c204eb89aaf53 | |
| parent | 839dd8341f9960b0fa792add2011b33dab66d7ac (diff) | |
| download | emacs-584b81041669d040a23cd7cd9c73421c8b59d210.tar.gz emacs-584b81041669d040a23cd7cd9c73421c8b59d210.zip | |
Explain after-change-functions and chars vs bytes.
| -rw-r--r-- | lispref/text.texi | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lispref/text.texi b/lispref/text.texi index 6ba44ecda1a..2780eb56452 100644 --- a/lispref/text.texi +++ b/lispref/text.texi | |||
| @@ -2973,9 +2973,16 @@ buffer that is about to change is always the current buffer. | |||
| 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 |