]> git.eshelyaron.com Git - emacs.git/commitdiff
Delete obsolete variable buffer-substring-filters
authorStefan Kangas <stefan@marxist.se>
Fri, 8 Jul 2022 12:46:20 +0000 (14:46 +0200)
committerStefan Kangas <stefan@marxist.se>
Sat, 9 Jul 2022 09:47:52 +0000 (11:47 +0200)
* 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.

doc/lispref/text.texi
etc/NEWS
lisp/simple.el

index 0c04d01261bef87bff2f538d80da61b1affae9ee..ab46afc838be1cad31689db00b8f1ae1d7f9d59e 100644 (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
index 5831bbefd4a03b104aea5e343daefe332af9c492..8c9a05775f2a77ef1662bec8c596c9af8d907577 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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',
index 1d251dbf5e676b5a3dc9d52d2d0461e1de4d7995..caba924f6a59eb3e5a7a92b3d0ef51fb35e4ded4 100644 (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)))))