comparison lispref/text.texi @ 69903:5b6c4153d145

(Buffer Contents): Add NOPROPS arg to filter-buffer-substring.
author Kim F. Storm <storm@cua.dk>
date Sun, 09 Apr 2006 23:05:07 +0000
parents 8d593746aa77
children 2fe766ffb2c0 c156f6a9e7b5
comparison
equal deleted inserted replaced
69902:eea8aee5048b 69903:5b6c4153d145
203 @defun buffer-substring-no-properties start end 203 @defun buffer-substring-no-properties start end
204 This is like @code{buffer-substring}, except that it does not copy text 204 This is like @code{buffer-substring}, except that it does not copy text
205 properties, just the characters themselves. @xref{Text Properties}. 205 properties, just the characters themselves. @xref{Text Properties}.
206 @end defun 206 @end defun
207 207
208 @defun filter-buffer-substring start end &optional delete 208 @defun filter-buffer-substring start end &optional delete noprops
209 This function passes the buffer text between @var{start} and @var{end} 209 This function passes the buffer text between @var{start} and @var{end}
210 through the filter functions specified by the variable 210 through the filter functions specified by the variable
211 @code{buffer-substring-filters}, and returns the value from the last 211 @code{buffer-substring-filters}, and returns the value from the last
212 filter function. If @code{buffer-substring-filters} is @code{nil}, 212 filter function. If @code{buffer-substring-filters} is @code{nil},
213 the value is the unaltered text from the buffer, what 213 the value is the unaltered text from the buffer, what
215 215
216 If @var{delete} is non-@code{nil}, this function deletes the text 216 If @var{delete} is non-@code{nil}, this function deletes the text
217 between @var{start} and @var{end} after copying it, like 217 between @var{start} and @var{end} after copying it, like
218 @code{delete-and-extract-region}. 218 @code{delete-and-extract-region}.
219 219
220 Lisp code should use this function instead of @code{buffer-substring} 220 If @var{noprops} is non-@code{nil}, the final string returned does not
221 include text properties, while the string passed through the filters
222 still includes text properties from the buffer text.
223
224 Lisp code should use this function instead of @code{buffer-substring},
225 @code{buffer-substring-no-properties},
221 or @code{delete-and-extract-region} when copying into user-accessible 226 or @code{delete-and-extract-region} when copying into user-accessible
222 data structures such as the kill-ring, X clipboard, and registers. 227 data structures such as the kill-ring, X clipboard, and registers.
223 Major and minor modes can add functions to 228 Major and minor modes can add functions to
224 @code{buffer-substring-filters} to alter such text as it is copied out 229 @code{buffer-substring-filters} to alter such text as it is copied out
225 of the buffer. 230 of the buffer.