aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el44
1 files changed, 23 insertions, 21 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index d1618a485ed..416d9f1d1ec 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -786,11 +786,11 @@ the function that you set this to can check `this-command'."
786 786
787(defun read-regexp-suggestions () 787(defun read-regexp-suggestions ()
788 "Return a list of standard suggestions for `read-regexp'. 788 "Return a list of standard suggestions for `read-regexp'.
789By default, the list includes the \"tag\" at point (see Info 789By default, the list includes the identifier (a.k.a. \"tag\")
790node `(emacs) Identifier Search'), the last isearch regexp, the 790at point (see Info node `(emacs) Identifier Search'), the last
791last isearch string, and the last replacement regexp. 791isearch regexp, the last isearch string, and the last
792`read-regexp' appends the list returned by this function to the 792replacement regexp. `read-regexp' appends the list returned
793end of values available via 793by this function to the end of values available via
794\\<minibuffer-local-map>\\[next-history-element]." 794\\<minibuffer-local-map>\\[next-history-element]."
795 (list 795 (list
796 (find-tag-default-as-regexp) 796 (find-tag-default-as-regexp)
@@ -805,33 +805,35 @@ Prompt with the string PROMPT. If PROMPT ends in \":\" (followed by
805optional whitespace), use it as-is. Otherwise, add \": \" to the end, 805optional whitespace), use it as-is. Otherwise, add \": \" to the end,
806possibly preceded by the default result (see below). 806possibly preceded by the default result (see below).
807 807
808The optional argument DEFAULTS can be either: nil, a string, a list 808The optional argument DEFAULTS is used to construct the default
809of strings, or a symbol. We use DEFAULTS to construct the default 809return value in case of empty input. DEFAULTS can be nil, a string,
810return value in case of empty input. 810a list of strings, or a symbol.
811 811
812If DEFAULTS is a string, we use it as-is. 812If DEFAULTS is a string, the function uses it as-is.
813 813
814If DEFAULTS is a list of strings, the first element is the 814If DEFAULTS is a list of strings, the first element is the
815default return value, but all the elements are accessible 815default return value, but all the elements are accessible
816using the history command \\<minibuffer-local-map>\\[next-history-element]. 816using the history command \\<minibuffer-local-map>\\[next-history-element].
817 817
818DEFAULTS can be a symbol. If DEFAULTS is the symbol 818If DEFAULTS is the symbol `regexp-history-last', the default return
819`regexp-history-last', we use the first element of HISTORY (if 819value will be the first element of HISTORY. If HISTORY is omitted or
820specified) or `regexp-history'. If DEFAULTS is a symbol with a 820nil, `regexp-history' is used instead.
821function definition, we call it with no arguments and use what it 821If DEFAULTS is a symbol with a function definition, it is called with
822returns, which should be either nil, a string, or a list of 822no arguments and should return either nil, a string, or a list of
823strings. Other symbol values for DEFAULTS are ignored. If 823strings, which will be used as above.
824`read-regexp-defaults-function' is non-nil, its value is used 824Other symbol values for DEFAULTS are ignored.
825instead of DEFAULTS in the two cases described in this paragraph.
826 825
827We append the standard values from `read-regexp-suggestions' to DEFAULTS 826If `read-regexp-defaults-function' is non-nil, its value is used
828before using it. 827instead of DEFAULTS in the two cases described in the last paragraph.
828
829Before using whatever value DEFAULTS yields, the function appends the
830standard values from `read-regexp-suggestions' to that value.
829 831
830If the first element of DEFAULTS is non-nil (and if PROMPT does not end 832If the first element of DEFAULTS is non-nil (and if PROMPT does not end
831in \":\", followed by optional whitespace), we add it to the prompt. 833in \":\", followed by optional whitespace), DEFAULT is added to the prompt.
832 834
833The optional argument HISTORY is a symbol to use for the history list. 835The optional argument HISTORY is a symbol to use for the history list.
834If nil, uses `regexp-history'." 836If nil, use `regexp-history'."
835 (let* ((defaults 837 (let* ((defaults
836 (if (and defaults (symbolp defaults)) 838 (if (and defaults (symbolp defaults))
837 (cond 839 (cond