aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2012-02-04 11:48:06 -0800
committerGlenn Morris2012-02-04 11:48:06 -0800
commit34c999980444dc3aea494fbf87d71d858fbc3f0f (patch)
treeb9a4a056c0cc3f5137e464e208a5a44a66ab8c90 /lisp
parent79c1cc1e971d0f8766e62d60f459d5253b913f05 (diff)
downloademacs-34c999980444dc3aea494fbf87d71d858fbc3f0f.tar.gz
emacs-34c999980444dc3aea494fbf87d71d858fbc3f0f.zip
Try to document filter-buffer-substring changes
* doc/lispref/text.texi (Buffer Contents): Update filter-buffer-substring description. * lisp/simple.el (filter-buffer-substring-functions) (buffer-substring-filters, filter-buffer-substring): Doc fixes. * etc/NEWS: Related edits.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el38
2 files changed, 33 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 888b7e20307..89ce0f67408 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-02-04 Glenn Morris <rgm@gnu.org>
2
3 * simple.el (filter-buffer-substring-functions)
4 (buffer-substring-filters, filter-buffer-substring): Doc fixes.
5
12012-02-04 Lars Ljung <lars@matholka.se> (tiny change) 62012-02-04 Lars Ljung <lars@matholka.se> (tiny change)
2 7
3 * eshell/esh-ext.el (eshell-windows-shell-file): Match "cmdproxy" 8 * eshell/esh-ext.el (eshell-windows-shell-file): Match "cmdproxy"
diff --git a/lisp/simple.el b/lisp/simple.el
index cc56dfe04ce..8bd32a8db8d 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2914,28 +2914,46 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
2914 2914
2915 2915
2916(defvar filter-buffer-substring-functions nil 2916(defvar filter-buffer-substring-functions nil
2917 "Wrapper hook around `filter-buffer-substring'. 2917 "This variable is a wrapper hook around `filter-buffer-substring'.
2918The functions on this special hook are called with four arguments: 2918Each member of the hook should be a function accepting four arguments:
2919 NEXT-FUN BEG END DELETE 2919\(FUN BEG END DELETE), where FUN is itself a function of three arguments
2920NEXT-FUN is a function of three arguments (BEG END DELETE) 2920\(BEG END DELETE). The arguments BEG, END, and DELETE are the same
2921that performs the default operation. The other three arguments 2921as those of `filter-buffer-substring' in each case.
2922are like the ones passed to `filter-buffer-substring'.") 2922
2923The first hook function to be called receives a FUN equivalent
2924to the default operation of `filter-buffer-substring',
2925i.e. one that returns the buffer-substring between BEG and
2926END (processed by any `buffer-substring-filters'). Normally,
2927the hook function will call FUN and then do its own processing
2928of the result. The next hook function receives a FUN equivalent
2929to the previous hook function, calls it, and does its own
2930processing, and so on. The overall result is that of all hook
2931functions acting in sequence.
2932
2933Any hook may choose not to call FUN though, in which case it
2934effectively replaces the default behavior with whatever it chooses.
2935Of course, a later hook function may do the same thing.")
2923 2936
2924(defvar buffer-substring-filters nil 2937(defvar buffer-substring-filters nil
2925 "List of filter functions for `filter-buffer-substring'. 2938 "List of filter functions for `filter-buffer-substring'.
2926Each function must accept a single argument, a string, and return 2939Each function must accept a single argument, a string, and return
2927a string. The buffer substring is passed to the first function 2940a string. The buffer substring is passed to the first function
2928in the list, and the return value of each function is passed to 2941in the list, and the return value of each function is passed to
2929the next. The return value of the last function is used as the 2942the next. The final result (if `buffer-substring-filters' is
2930return value of `filter-buffer-substring'. 2943nil, this is the unfiltered buffer-substring) is passed to the
2944first function on `filter-buffer-substring-functions'.
2931 2945
2932If this variable is nil, no filtering is performed.") 2946As a special convention, point is set to the start of the buffer text
2947being operated on (i.e., the first argument of `filter-buffer-substring')
2948before these functions are called.")
2933(make-obsolete-variable 'buffer-substring-filters 2949(make-obsolete-variable 'buffer-substring-filters
2934 'filter-buffer-substring-functions "24.1") 2950 'filter-buffer-substring-functions "24.1")
2935 2951
2936(defun filter-buffer-substring (beg end &optional delete) 2952(defun filter-buffer-substring (beg end &optional delete)
2937 "Return the buffer substring between BEG and END, after filtering. 2953 "Return the buffer substring between BEG and END, after filtering.
2938The filtering is performed by `filter-buffer-substring-functions'. 2954The wrapper hook `filter-buffer-substring-functions' performs
2955the actual filtering. The obsolete variable `buffer-substring-filters'
2956is also consulted. If both of these are nil, no filtering is done.
2939 2957
2940If DELETE is non-nil, the text between BEG and END is deleted 2958If DELETE is non-nil, the text between BEG and END is deleted
2941from the buffer. 2959from the buffer.