# HG changeset patch # User Richard M. Stallman # Date 872229497 0 # Node ID d76f57ca7aba42ca5b8ec819042ea477920dd2b0 # Parent 3fce1e7c0fd075279900364b04089c324cc40466 Explain after-change-functions and chars vs bytes. diff -r 3fce1e7c0fd0 -r d76f57ca7aba lispref/text.texi --- a/lispref/text.texi Fri Aug 22 05:51:48 1997 +0000 +++ b/lispref/text.texi Fri Aug 22 05:58:17 1997 +0000 @@ -2973,9 +2973,16 @@ This variable holds a list of a functions to call after any buffer modification. Each function receives three arguments: the beginning and end of the region just changed, and the length of the text that existed -before the change. (To get the current length, subtract the region -beginning from the region end.) All three arguments are integers. The -buffer that's about to change is always the current buffer. +before the change. All three arguments are integers. The buffer that's +about to change is always the current buffer. + +The length of the old text is measured in bytes; it is the difference +between the buffer positions before and after that text, before the +change. As for the changed text, its length in bytes is simply the +difference between the first two arguments. If you want the length +in @emph{characters} of the text before the change, you should use +a @code{before-change-functions} function that calls @code{chars-in-region} +(@pxref{Chars and Bytes}). @end defvar @defvar before-change-function