aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-07-08 14:46:20 +0200
committerStefan Kangas2022-07-09 11:47:52 +0200
commitac7b90e323eb375d5ff48fb24df206dc6336e656 (patch)
treed0757172ea73f5d73927cf053502deccd32420ab
parent6caade631ef9b80f751ce94d14252c1fb802fce0 (diff)
downloademacs-ac7b90e323eb375d5ff48fb24df206dc6336e656.tar.gz
emacs-ac7b90e323eb375d5ff48fb24df206dc6336e656.zip
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.
-rw-r--r--doc/lispref/text.texi28
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/simple.el22
3 files changed, 14 insertions, 41 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 0c04d01261b..ab46afc838b 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -243,10 +243,8 @@ using a function specified by the variable
243The default filter function consults the obsolete wrapper hook 243The default filter function consults the obsolete wrapper hook
244@code{filter-buffer-substring-functions} (see the documentation string 244@code{filter-buffer-substring-functions} (see the documentation string
245of the macro @code{with-wrapper-hook} for the details about this 245of the macro @code{with-wrapper-hook} for the details about this
246obsolete facility), and the obsolete variable 246obsolete facility). If it is @code{nil}, it returns the unaltered
247@code{buffer-substring-filters}. If both of these are @code{nil}, it 247text from the buffer, i.e., what @code{buffer-substring} would return.
248returns the unaltered text from the buffer, i.e., what
249@code{buffer-substring} would return.
250 248
251If @var{delete} is non-@code{nil}, the function deletes the text 249If @var{delete} is non-@code{nil}, the function deletes the text
252between @var{start} and @var{end} after copying it, like 250between @var{start} and @var{end} after copying it, like
@@ -282,22 +280,12 @@ the same as those of @code{filter-buffer-substring}.
282 280
283The first hook function is passed a @var{fun} that is equivalent to 281The first hook function is passed a @var{fun} that is equivalent to
284the default operation of @code{filter-buffer-substring}, i.e., it 282the default operation of @code{filter-buffer-substring}, i.e., it
285returns the buffer-substring between @var{start} and @var{end} 283returns the buffer-substring between @var{start} and @var{end} and
286(processed by any @code{buffer-substring-filters}) and optionally 284optionally deletes the original text from the buffer. In most cases,
287deletes the original text from the buffer. In most cases, the hook 285the hook function will call @var{fun} once, and then do its own
288function will call @var{fun} once, and then do its own processing of 286processing of the result. The next hook function receives a @var{fun}
289the result. The next hook function receives a @var{fun} equivalent to 287equivalent to this, and so on. The actual return value is the result
290this, and so on. The actual return value is the result of all the 288of all the hook functions acting in sequence.
291hook functions acting in sequence.
292@end defvar
293
294@defvar buffer-substring-filters
295The value of this obsolete variable should be a list of functions
296that accept a single string argument and return another string.
297The default @code{filter-buffer-substring} function passes the buffer
298substring to the first function in this list, and the return value of
299each function is passed to the next function. The return value of the
300last function is passed to @code{filter-buffer-substring-functions}.
301@end defvar 289@end defvar
302 290
303@defun current-word &optional strict really-word 291@defun current-word &optional strict really-word
diff --git a/etc/NEWS b/etc/NEWS
index 5831bbefd4a..8c9a05775f2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2261,8 +2261,9 @@ This change is now applied in 'dired-insert-directory'.
2261'allout-mode-deactivate-hook', 'ansi-color-unfontify-region', 2261'allout-mode-deactivate-hook', 'ansi-color-unfontify-region',
2262'auth-source-forget-user-or-password', 'auth-source-hide-passwords', 2262'auth-source-forget-user-or-password', 'auth-source-hide-passwords',
2263'auth-source-user-or-password', 'bibtex-complete', 2263'auth-source-user-or-password', 'bibtex-complete',
2264'bibtex-entry-field-alist', 'byte-compile-disable-print-circle', 2264'bibtex-entry-field-alist', 'buffer-substring-filters',
2265'cfengine-mode-abbrevs', 'chart-map', 'comint-dynamic-complete', 2265'byte-compile-disable-print-circle', 'cfengine-mode-abbrevs',
2266'chart-map', 'comint-dynamic-complete',
2266'comint-dynamic-complete-as-filename', 2267'comint-dynamic-complete-as-filename',
2267'comint-dynamic-simple-complete', 'command-history-map', 2268'comint-dynamic-simple-complete', 'command-history-map',
2268'completion-annotate-function', 'condition-case-no-debug', 2269'completion-annotate-function', 'condition-case-no-debug',
diff --git a/lisp/simple.el b/lisp/simple.el
index 1d251dbf5e6..caba924f6a5 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5352,17 +5352,6 @@ that `filter-buffer-substring' received. It should return the
5352buffer substring between BEG and END, after filtering. If DELETE is 5352buffer substring between BEG and END, after filtering. If DELETE is
5353non-nil, it should delete the text between BEG and END from the buffer.") 5353non-nil, it should delete the text between BEG and END from the buffer.")
5354 5354
5355(defvar buffer-substring-filters nil
5356 "List of filter functions for `buffer-substring--filter'.
5357Each function must accept a single argument, a string, and return a string.
5358The buffer substring is passed to the first function in the list,
5359and the return value of each function is passed to the next.
5360As a special convention, point is set to the start of the buffer text
5361being operated on (i.e., the first argument of `buffer-substring--filter')
5362before these functions are called.")
5363(make-obsolete-variable 'buffer-substring-filters
5364 'filter-buffer-substring-function "24.1")
5365
5366(defun filter-buffer-substring (beg end &optional delete) 5355(defun filter-buffer-substring (beg end &optional delete)
5367 "Return the buffer substring between BEG and END, after filtering. 5356 "Return the buffer substring between BEG and END, after filtering.
5368If DELETE is non-nil, delete the text between BEG and END from the buffer. 5357If 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."
5383 "Default function to use for `filter-buffer-substring-function'. 5372 "Default function to use for `filter-buffer-substring-function'.
5384Its arguments and return value are as specified for `filter-buffer-substring'. 5373Its arguments and return value are as specified for `filter-buffer-substring'.
5385Also respects the obsolete wrapper hook `filter-buffer-substring-functions' 5374Also respects the obsolete wrapper hook `filter-buffer-substring-functions'
5386\(see `with-wrapper-hook' for details about wrapper hooks), 5375(see `with-wrapper-hook' for details about wrapper hooks).
5387and the abnormal hook `buffer-substring-filters'.
5388No filtering is done unless a hook says to." 5376No filtering is done unless a hook says to."
5389 (subr--with-wrapper-hook-no-warnings 5377 (subr--with-wrapper-hook-no-warnings
5390 filter-buffer-substring-functions (beg end delete) 5378 filter-buffer-substring-functions (beg end delete)
5391 (cond 5379 (cond
5392 ((or delete buffer-substring-filters) 5380 (delete
5393 (save-excursion 5381 (save-excursion
5394 (goto-char beg) 5382 (goto-char beg)
5395 (let ((string (if delete (delete-and-extract-region beg end) 5383 (delete-and-extract-region beg end)))
5396 (buffer-substring beg end))))
5397 (dolist (filter buffer-substring-filters)
5398 (setq string (funcall filter string)))
5399 string)))
5400 (t 5384 (t
5401 (buffer-substring beg end))))) 5385 (buffer-substring beg end)))))
5402 5386