Merged from miles@gnu.org--gnu-2005 (patch 269)
[bpt/emacs.git] / lispref / text.texi
index f60dd92..1d4dc0f 100644 (file)
@@ -207,6 +207,41 @@ This is like @code{buffer-substring}, except that it does not copy text
 properties, just the characters themselves.  @xref{Text Properties}.
 @end defun
 
+@defun filter-buffer-substring start end &optional delete
+This function passes the buffer text between @var{start} and @var{end}
+through the filter functions specified by the variable
+@code{buffer-substring-filters}, and returns the value from the last
+filter function.  If @code{buffer-substring-filters} is @code{nil},
+the value is the unaltered text from the buffer, what
+@code{buffer-substring} would return.
+
+If @var{delete} is non-@code{nil}, this function deletes the text
+between @var{start} and @var{end} after copying it, like
+@code{delete-and-extract-region}.
+
+Lisp code should use this function instead of @code{buffer-substring}
+or @code{delete-and-extract-region} when copying into user-accessible
+data structures such as the kill-ring, X clipboard, and registers.
+Major and minor modes can add functions to
+@code{buffer-substring-filters} to alter such text as it is copied out
+of the buffer.
+@end defun
+
+@defvar buffer-substring-filters
+This variable should be a list of functions that accept a single
+argument, a string, and return a string.
+@code{filter-buffer-substring} passes the buffer substring to the
+first function in this list, and the return value of each function is
+passed to the next function.  The return value of the last function is
+used as the return value of @code{filter-buffer-substring}.
+
+As a special convention, point is set to the start of the buffer text
+being operated on (i.e., the @var{start} argument for
+@code{filter-buffer-substring}) before these functions are called.
+
+If this variable is @code{nil}, no filtering is performed.
+@end defvar
+
 @defun buffer-string
 This function returns the contents of the entire accessible portion of
 the current buffer as a string.  It is equivalent to
@@ -1228,6 +1263,16 @@ relocated due to deletion of surrounding text, and that it moved
 @var{adjustment} character positions.  Undoing this element moves
 @var{marker} @minus{} @var{adjustment} characters.
 
+@item (apply @var{funname} . @var{args})
+This is an extensible undo item, which is undone by calling
+@var{funname} with arguments @var{args}.
+
+@item (apply @var{delta} @var{beg} @var{end} @var{funname} . @var{args})
+This is an extensible undo item, which records a change limited to the
+range @var{beg} to @var{end}, which increased the size of the buffer
+by @var{delta}.  It is undone by calling @var{funname} with arguments
+@var{args}.
+
 @item nil
 This element is a boundary.  The elements between two boundaries are
 called a @dfn{change group}; normally, each change group corresponds to
@@ -1480,6 +1525,17 @@ does not count as the end of a sentence, and the filling functions
 avoid breaking the line at such a place.
 @end defopt
 
+@defopt sentence-end-without-period
+If this variable is non-@code{nil}, a sentence can end without a
+period.  This is used for languages like Thai, where sentences end
+with a double space but without a period.
+@end defopt
+
+@defopt sentence-end-without-space
+If this variable is non-@code{nil}, it should be a string of
+characters that can end a sentence without following spaces.
+@end defopt
+
 @defvar fill-paragraph-function
 This variable provides a way for major modes to override the filling of
 paragraphs.  If the value is non-@code{nil}, @code{fill-paragraph} calls
@@ -2619,9 +2675,9 @@ list.
 @end defun
 
 @defun remove-list-of-text-properties start end list-of-properties &optional object
-Like @code{remove-list-properties} except that
+Like @code{remove-text-properties} except that
 @var{list-of-properties} is a list property names only, not an
-alternating list of property values.
+alternating list of property names and values.
 @end defun
 
 @defun set-text-properties start end props &optional object
@@ -4225,8 +4281,6 @@ disabled; none of them run.  This affects all the hook variables
 described above in this section, as well as the hooks attached to
 certain special text properties (@pxref{Special Properties}) and overlay
 properties (@pxref{Overlay Properties}).
-
-This variable is available starting in Emacs 21.
 @end defvar
 
 @ignore