diff options
| author | Glenn Morris | 2014-05-26 18:53:45 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-05-26 18:53:45 -0700 |
| commit | e9e341bb4bf06b25bc4feb754544c77b0021a3bd (patch) | |
| tree | 649355b23a679308903efa3d0f31619f6b5c0463 /doc | |
| parent | 4a12fa5c2e0d69d3dfbf94c9367006ab545e93cc (diff) | |
| download | emacs-e9e341bb4bf06b25bc4feb754544c77b0021a3bd.tar.gz emacs-e9e341bb4bf06b25bc4feb754544c77b0021a3bd.zip | |
Doc updates re filter-buffer-substring
* lisp/simple.el (filter-buffer-substring-functions)
(filter-buffer-substring-function, buffer-substring-filters)
(filter-buffer-substring, buffer-substring--filter): Doc fixes.
* doc/lispref/text.texi (Buffer Contents):
Update for filter-buffer-substring changes.
* doc/lispref/hooks.texi: Remove old comment.
* etc/NEWS: Related markup.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 3 | ||||
| -rw-r--r-- | doc/lispref/hooks.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 65 |
3 files changed, 40 insertions, 29 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 75933560739..e4f5c60c2d1 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2014-05-27 Glenn Morris <rgm@gnu.org> | 1 | 2014-05-27 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * text.texi (Buffer Contents): | ||
| 4 | Update for filter-buffer-substring changes. | ||
| 5 | |||
| 3 | * abbrevs.texi (Abbrev Expansion): Update for expand-abbrev changes. | 6 | * abbrevs.texi (Abbrev Expansion): Update for expand-abbrev changes. |
| 4 | * functions.texi (Advising Functions): Standardize menu case. | 7 | * functions.texi (Advising Functions): Standardize menu case. |
| 5 | 8 | ||
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi index 19e30163590..9408174872d 100644 --- a/doc/lispref/hooks.texi +++ b/doc/lispref/hooks.texi | |||
| @@ -243,7 +243,6 @@ completion-at-point-functions | |||
| 243 | completion-list-insert-choice-function | 243 | completion-list-insert-choice-function |
| 244 | deactivate-current-input-method-function | 244 | deactivate-current-input-method-function |
| 245 | describe-current-input-method-function | 245 | describe-current-input-method-function |
| 246 | filter-buffer-substring-functions | ||
| 247 | font-lock-function | 246 | font-lock-function |
| 248 | menu-bar-select-buffer-function | 247 | menu-bar-select-buffer-function |
| 249 | read-file-name-function | 248 | read-file-name-function |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 3c70f5f96b0..4c3286adbfc 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -220,15 +220,17 @@ the current buffer, as a string. | |||
| 220 | @end defun | 220 | @end defun |
| 221 | 221 | ||
| 222 | @defun filter-buffer-substring start end &optional delete | 222 | @defun filter-buffer-substring start end &optional delete |
| 223 | This function passes the buffer text between @var{start} and @var{end} | 223 | This function filters the buffer text between @var{start} and @var{end} |
| 224 | through the filter functions specified by the wrapper hook | 224 | using a function specified by the variable |
| 225 | @code{filter-buffer-substring-functions}, and returns the result. The | 225 | @code{filter-buffer-substring-function}, and returns the result. |
| 226 | obsolete variable @code{buffer-substring-filters} is also consulted. | 226 | |
| 227 | If both of these variables are @code{nil}, the value is the unaltered | 227 | The default filter function consults the obsolete wrapper hook |
| 228 | text from the buffer, i.e., what @code{buffer-substring} would | 228 | @code{filter-buffer-substring-functions}, and the obsolete variable |
| 229 | return. | 229 | @code{buffer-substring-filters}. If both of these are @code{nil}, it |
| 230 | 230 | returns the unaltered text from the buffer, i.e., what | |
| 231 | If @var{delete} is non-@code{nil}, this function deletes the text | 231 | @code{buffer-substring} would return. |
| 232 | |||
| 233 | If @var{delete} is non-@code{nil}, the function deletes the text | ||
| 232 | between @var{start} and @var{end} after copying it, like | 234 | between @var{start} and @var{end} after copying it, like |
| 233 | @code{delete-and-extract-region}. | 235 | @code{delete-and-extract-region}. |
| 234 | 236 | ||
| @@ -236,20 +238,29 @@ Lisp code should use this function instead of @code{buffer-substring}, | |||
| 236 | @code{buffer-substring-no-properties}, | 238 | @code{buffer-substring-no-properties}, |
| 237 | or @code{delete-and-extract-region} when copying into user-accessible | 239 | or @code{delete-and-extract-region} when copying into user-accessible |
| 238 | data structures such as the kill-ring, X clipboard, and registers. | 240 | data structures such as the kill-ring, X clipboard, and registers. |
| 239 | Major and minor modes can add functions to | 241 | Major and minor modes can modify @code{filter-buffer-substring-function} |
| 240 | @code{filter-buffer-substring-functions} to alter such text as it is | 242 | to alter such text as it is copied out of the buffer. |
| 241 | copied out of the buffer. | ||
| 242 | @end defun | 243 | @end defun |
| 243 | 244 | ||
| 244 | @c FIXME: `filter-buffer-substring-function' should be documented. | 245 | @defvar filter-buffer-substring-function |
| 246 | The value of this variable is a function that @code{filter-buffer-substring} | ||
| 247 | will call to do the actual work. The function receives three | ||
| 248 | arguments, the same as those of @code{filter-buffer-substring}, | ||
| 249 | which it should treat as per the documentation of that function. It | ||
| 250 | should return the filtered text (and optionally delete the source text). | ||
| 251 | @end defvar | ||
| 252 | |||
| 253 | @noindent The following two variables are obsoleted by | ||
| 254 | @code{filter-buffer-substring-function}, but are still supported for | ||
| 255 | backward compatibility. | ||
| 256 | |||
| 245 | @defvar filter-buffer-substring-functions | 257 | @defvar filter-buffer-substring-functions |
| 246 | This variable is a wrapper hook (@pxref{Running Hooks}), whose members | 258 | This obsolete variable is a wrapper hook, whose members should be functions |
| 247 | should be functions that accept four arguments: @var{fun}, | 259 | that accept four arguments: @var{fun}, @var{start}, @var{end}, and |
| 248 | @var{start}, @var{end}, and @var{delete}. @var{fun} is a function | 260 | @var{delete}. @var{fun} is a function that takes three arguments |
| 249 | that takes three arguments (@var{start}, @var{end}, and @var{delete}), | 261 | (@var{start}, @var{end}, and @var{delete}), and returns a string. In |
| 250 | and returns a string. In both cases, the @var{start}, @var{end}, and | 262 | both cases, the @var{start}, @var{end}, and @var{delete} arguments are |
| 251 | @var{delete} arguments are the same as those of | 263 | the same as those of @code{filter-buffer-substring}. |
| 252 | @code{filter-buffer-substring}. | ||
| 253 | 264 | ||
| 254 | The first hook function is passed a @var{fun} that is equivalent to | 265 | The first hook function is passed a @var{fun} that is equivalent to |
| 255 | the default operation of @code{filter-buffer-substring}, i.e., it | 266 | the default operation of @code{filter-buffer-substring}, i.e., it |
| @@ -263,14 +274,12 @@ hook functions acting in sequence. | |||
| 263 | @end defvar | 274 | @end defvar |
| 264 | 275 | ||
| 265 | @defvar buffer-substring-filters | 276 | @defvar buffer-substring-filters |
| 266 | This variable is obsoleted by | 277 | The value of this obsolete variable should be a list of functions |
| 267 | @code{filter-buffer-substring-functions}, but is still supported for | 278 | that accept a single string argument and return another string. |
| 268 | backward compatibility. Its value should should be a list of | 279 | The default @code{filter-buffer-substring} function passes the buffer |
| 269 | functions which accept a single string argument and return another | 280 | substring to the first function in this list, and the return value of |
| 270 | string. @code{filter-buffer-substring} passes the buffer substring to | 281 | each function is passed to the next function. The return value of the |
| 271 | the first function in this list, and the return value of each function | 282 | last function is passed to @code{filter-buffer-substring-functions}. |
| 272 | is passed to the next function. The return value of the last function | ||
| 273 | is passed to @code{filter-buffer-substring-functions}. | ||
| 274 | @end defvar | 283 | @end defvar |
| 275 | 284 | ||
| 276 | @defun current-word &optional strict really-word | 285 | @defun current-word &optional strict really-word |