diff options
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 44 |
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'. |
| 789 | By default, the list includes the \"tag\" at point (see Info | 789 | By default, the list includes the identifier (a.k.a. \"tag\") |
| 790 | node `(emacs) Identifier Search'), the last isearch regexp, the | 790 | at point (see Info node `(emacs) Identifier Search'), the last |
| 791 | last isearch string, and the last replacement regexp. | 791 | isearch regexp, the last isearch string, and the last |
| 792 | `read-regexp' appends the list returned by this function to the | 792 | replacement regexp. `read-regexp' appends the list returned |
| 793 | end of values available via | 793 | by 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 | |||
| 805 | optional whitespace), use it as-is. Otherwise, add \": \" to the end, | 805 | optional whitespace), use it as-is. Otherwise, add \": \" to the end, |
| 806 | possibly preceded by the default result (see below). | 806 | possibly preceded by the default result (see below). |
| 807 | 807 | ||
| 808 | The optional argument DEFAULTS can be either: nil, a string, a list | 808 | The optional argument DEFAULTS is used to construct the default |
| 809 | of strings, or a symbol. We use DEFAULTS to construct the default | 809 | return value in case of empty input. DEFAULTS can be nil, a string, |
| 810 | return value in case of empty input. | 810 | a list of strings, or a symbol. |
| 811 | 811 | ||
| 812 | If DEFAULTS is a string, we use it as-is. | 812 | If DEFAULTS is a string, the function uses it as-is. |
| 813 | 813 | ||
| 814 | If DEFAULTS is a list of strings, the first element is the | 814 | If DEFAULTS is a list of strings, the first element is the |
| 815 | default return value, but all the elements are accessible | 815 | default return value, but all the elements are accessible |
| 816 | using the history command \\<minibuffer-local-map>\\[next-history-element]. | 816 | using the history command \\<minibuffer-local-map>\\[next-history-element]. |
| 817 | 817 | ||
| 818 | DEFAULTS can be a symbol. If DEFAULTS is the symbol | 818 | If DEFAULTS is the symbol `regexp-history-last', the default return |
| 819 | `regexp-history-last', we use the first element of HISTORY (if | 819 | value will be the first element of HISTORY. If HISTORY is omitted or |
| 820 | specified) or `regexp-history'. If DEFAULTS is a symbol with a | 820 | nil, `regexp-history' is used instead. |
| 821 | function definition, we call it with no arguments and use what it | 821 | If DEFAULTS is a symbol with a function definition, it is called with |
| 822 | returns, which should be either nil, a string, or a list of | 822 | no arguments and should return either nil, a string, or a list of |
| 823 | strings. Other symbol values for DEFAULTS are ignored. If | 823 | strings, which will be used as above. |
| 824 | `read-regexp-defaults-function' is non-nil, its value is used | 824 | Other symbol values for DEFAULTS are ignored. |
| 825 | instead of DEFAULTS in the two cases described in this paragraph. | ||
| 826 | 825 | ||
| 827 | We append the standard values from `read-regexp-suggestions' to DEFAULTS | 826 | If `read-regexp-defaults-function' is non-nil, its value is used |
| 828 | before using it. | 827 | instead of DEFAULTS in the two cases described in the last paragraph. |
| 828 | |||
| 829 | Before using whatever value DEFAULTS yields, the function appends the | ||
| 830 | standard values from `read-regexp-suggestions' to that value. | ||
| 829 | 831 | ||
| 830 | If the first element of DEFAULTS is non-nil (and if PROMPT does not end | 832 | If the first element of DEFAULTS is non-nil (and if PROMPT does not end |
| 831 | in \":\", followed by optional whitespace), we add it to the prompt. | 833 | in \":\", followed by optional whitespace), DEFAULT is added to the prompt. |
| 832 | 834 | ||
| 833 | The optional argument HISTORY is a symbol to use for the history list. | 835 | The optional argument HISTORY is a symbol to use for the history list. |
| 834 | If nil, uses `regexp-history'." | 836 | If 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 |