aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorStefan Monnier2015-08-11 11:43:10 -0400
committerStefan Monnier2015-08-11 11:43:10 -0400
commit6171d5b1f9edb09ca43c219f08e7a372de8740b2 (patch)
tree6a82856ec96cc28846b9ef2fdc77c3c104d6338c /lisp/replace.el
parentacde89a2088180831e506d0c4255b306a339e291 (diff)
downloademacs-6171d5b1f9edb09ca43c219f08e7a372de8740b2.tar.gz
emacs-6171d5b1f9edb09ca43c219f08e7a372de8740b2.zip
* lisp/replace.el (perform-replace): Document `replacements'.
(perform-replace): Move the description of the format of `replacements' from the body's comment to the docstring.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index a541c5530c4..aa1da08eca3 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2080,7 +2080,13 @@ see the documentation of `replace-match' to find out how to simulate
2080`case-replace'. 2080`case-replace'.
2081 2081
2082This function returns nil if and only if there were no matches to 2082This function returns nil if and only if there were no matches to
2083make, or the user didn't cancel the call." 2083make, or the user didn't cancel the call.
2084
2085REPLACEMENTS is either a string, a list of strings, or a cons cell
2086containing a function and its first argument. The function is
2087called to generate each replacement like this:
2088 (funcall (car replacements) (cdr replacements) replace-count)
2089It must return a string."
2084 (or map (setq map query-replace-map)) 2090 (or map (setq map query-replace-map))
2085 (and query-flag minibuffer-auto-raise 2091 (and query-flag minibuffer-auto-raise
2086 (raise-frame (window-frame (minibuffer-window)))) 2092 (raise-frame (window-frame (minibuffer-window))))
@@ -2136,11 +2142,6 @@ make, or the user didn't cancel the call."
2136 (when (eq (lookup-key map (vector last-input-event)) 'automatic-all) 2142 (when (eq (lookup-key map (vector last-input-event)) 'automatic-all)
2137 (setq query-flag nil multi-buffer t)) 2143 (setq query-flag nil multi-buffer t))
2138 2144
2139 ;; REPLACEMENTS is either a string, a list of strings, or a cons cell
2140 ;; containing a function and its first argument. The function is
2141 ;; called to generate each replacement like this:
2142 ;; (funcall (car replacements) (cdr replacements) replace-count)
2143 ;; It must return a string.
2144 (cond 2145 (cond
2145 ((stringp replacements) 2146 ((stringp replacements)
2146 (setq next-replacement replacements 2147 (setq next-replacement replacements