207 |
properties, just the characters themselves. @xref{Text Properties}. |
properties, just the characters themselves. @xref{Text Properties}. |
208 |
@end defun |
@end defun |
209 |
|
|
210 |
|
@defun filter-buffer-substring start end &optional delete |
211 |
|
This function passes the buffer text between @var{start} and @var{end} |
212 |
|
through the filter functions specified by the variable |
213 |
|
@code{buffer-substring-filters}, and returns the value from the last |
214 |
|
filter function. If @code{buffer-substring-filters} is @code{nil}, |
215 |
|
the value is the unaltered text from the buffer, what |
216 |
|
@code{buffer-substring} would return. |
217 |
|
|
218 |
|
If @var{delete} is non-@code{nil}, this function deletes the text |
219 |
|
between @var{start} and @var{end} after copying it, like |
220 |
|
@code{delete-and-extract-region}. |
221 |
|
|
222 |
|
Lisp code should use this function instead of @code{buffer-substring} |
223 |
|
or @code{delete-and-extract-region} when copying into user-accessible |
224 |
|
data structures such as the kill-ring, X clipboard, and registers. |
225 |
|
Major and minor modes can add functions to |
226 |
|
@code{buffer-substring-filters} to alter such text as it is copied out |
227 |
|
of the buffer. |
228 |
|
@end defun |
229 |
|
|
230 |
|
@defvar buffer-substring-filters |
231 |
|
This variable should be a list of functions that accept a single |
232 |
|
argument, a string, and return a string. |
233 |
|
@code{filter-buffer-substring} passes the buffer substring to the |
234 |
|
first function in this list, and the return value of each function is |
235 |
|
passed to the next function. The return value of the last function is |
236 |
|
used as the return value of @code{filter-buffer-substring}. |
237 |
|
|
238 |
|
As a special convention, point is set to the start of the buffer text |
239 |
|
being operated on (i.e., the @var{start} argument for |
240 |
|
@code{filter-buffer-substring}) before these functions are called. |
241 |
|
|
242 |
|
If this variable is @code{nil}, no filtering is performed. |
243 |
|
@end defvar |
244 |
|
|
245 |
@defun buffer-string |
@defun buffer-string |
246 |
This function returns the contents of the entire accessible portion of |
This function returns the contents of the entire accessible portion of |
247 |
the current buffer as a string. It is equivalent to |
the current buffer as a string. It is equivalent to |