1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Delete obsolete variable buffer-substring-filters

* lisp/simple.el (buffer-substring-filters): Delete variable obsolete
since 24.1.
(buffer-substring--filter): Adjust for deleted variable.
* doc/lispref/text.texi (Buffer Contents): Adjust documentation
for deleted variable.
This commit is contained in:
Stefan Kangas 2022-07-08 14:46:20 +02:00
parent 6caade631e
commit ac7b90e323
3 changed files with 14 additions and 41 deletions

View file

@ -243,10 +243,8 @@ using a function specified by the variable
The default filter function consults the obsolete wrapper hook
@code{filter-buffer-substring-functions} (see the documentation string
of the macro @code{with-wrapper-hook} for the details about this
obsolete facility), and the obsolete variable
@code{buffer-substring-filters}. If both of these are @code{nil}, it
returns the unaltered text from the buffer, i.e., what
@code{buffer-substring} would return.
obsolete facility). If it is @code{nil}, it returns the unaltered
text from the buffer, i.e., what @code{buffer-substring} would return.
If @var{delete} is non-@code{nil}, the function deletes the text
between @var{start} and @var{end} after copying it, like
@ -282,22 +280,12 @@ the same as those of @code{filter-buffer-substring}.
The first hook function is passed a @var{fun} that is equivalent to
the default operation of @code{filter-buffer-substring}, i.e., it
returns the buffer-substring between @var{start} and @var{end}
(processed by any @code{buffer-substring-filters}) and optionally
deletes the original text from the buffer. In most cases, the hook
function will call @var{fun} once, and then do its own processing of
the result. The next hook function receives a @var{fun} equivalent to
this, and so on. The actual return value is the result of all the
hook functions acting in sequence.
@end defvar
@defvar buffer-substring-filters
The value of this obsolete variable should be a list of functions
that accept a single string argument and return another string.
The default @code{filter-buffer-substring} function 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 passed to @code{filter-buffer-substring-functions}.
returns the buffer-substring between @var{start} and @var{end} and
optionally deletes the original text from the buffer. In most cases,
the hook function will call @var{fun} once, and then do its own
processing of the result. The next hook function receives a @var{fun}
equivalent to this, and so on. The actual return value is the result
of all the hook functions acting in sequence.
@end defvar
@defun current-word &optional strict really-word

View file

@ -2261,8 +2261,9 @@ This change is now applied in 'dired-insert-directory'.
'allout-mode-deactivate-hook', 'ansi-color-unfontify-region',
'auth-source-forget-user-or-password', 'auth-source-hide-passwords',
'auth-source-user-or-password', 'bibtex-complete',
'bibtex-entry-field-alist', 'byte-compile-disable-print-circle',
'cfengine-mode-abbrevs', 'chart-map', 'comint-dynamic-complete',
'bibtex-entry-field-alist', 'buffer-substring-filters',
'byte-compile-disable-print-circle', 'cfengine-mode-abbrevs',
'chart-map', 'comint-dynamic-complete',
'comint-dynamic-complete-as-filename',
'comint-dynamic-simple-complete', 'command-history-map',
'completion-annotate-function', 'condition-case-no-debug',

View file

@ -5352,17 +5352,6 @@ that `filter-buffer-substring' received. It should return the
buffer substring between BEG and END, after filtering. If DELETE is
non-nil, it should delete the text between BEG and END from the buffer.")
(defvar buffer-substring-filters nil
"List of filter functions for `buffer-substring--filter'.
Each function must accept a single argument, a string, and return a string.
The buffer substring is passed to the first function in the list,
and the return value of each function is passed to the next.
As a special convention, point is set to the start of the buffer text
being operated on (i.e., the first argument of `buffer-substring--filter')
before these functions are called.")
(make-obsolete-variable 'buffer-substring-filters
'filter-buffer-substring-function "24.1")
(defun filter-buffer-substring (beg end &optional delete)
"Return the buffer substring between BEG and END, after filtering.
If DELETE is non-nil, delete the text between BEG and END from the buffer.
@ -5383,20 +5372,15 @@ that are special to a buffer, and should not be copied into other buffers."
"Default function to use for `filter-buffer-substring-function'.
Its arguments and return value are as specified for `filter-buffer-substring'.
Also respects the obsolete wrapper hook `filter-buffer-substring-functions'
\(see `with-wrapper-hook' for details about wrapper hooks),
and the abnormal hook `buffer-substring-filters'.
(see `with-wrapper-hook' for details about wrapper hooks).
No filtering is done unless a hook says to."
(subr--with-wrapper-hook-no-warnings
filter-buffer-substring-functions (beg end delete)
(cond
((or delete buffer-substring-filters)
(delete
(save-excursion
(goto-char beg)
(let ((string (if delete (delete-and-extract-region beg end)
(buffer-substring beg end))))
(dolist (filter buffer-substring-filters)
(setq string (funcall filter string)))
string)))
(delete-and-extract-region beg end)))
(t
(buffer-substring beg end)))))