diff options
| author | Eli Zaretskii | 2021-01-27 17:15:46 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2021-01-27 17:15:46 +0200 |
| commit | 49eb03d6c8a181fd46adbbcf1f0a976d0a9efa87 (patch) | |
| tree | 7972e6e78e4ea78ff02d035d6a323a6b987901f7 /lisp/replace.el | |
| parent | 08574a7f40f27ad29efb8f7d975012ecc9111717 (diff) | |
| download | emacs-49eb03d6c8a181fd46adbbcf1f0a976d0a9efa87.tar.gz emacs-49eb03d6c8a181fd46adbbcf1f0a976d0a9efa87.zip | |
Improve documentation of 'read-regexp' and friends
* doc/emacs/glossary.texi (Glossary): Add "Tag" to the Glossary.
* doc/emacs/maintaining.texi (Xref): Mention that identifiers are
also known as "tags".
* lisp/replace.el (read-regexp, read-regexp-suggestions): Improve
wording of doc strings. (Bug#46088) (Bug#46089)
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 32fbc24064c..4483d7f7800 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -808,11 +808,11 @@ the function that you set this to can check `this-command'." | |||
| 808 | 808 | ||
| 809 | (defun read-regexp-suggestions () | 809 | (defun read-regexp-suggestions () |
| 810 | "Return a list of standard suggestions for `read-regexp'. | 810 | "Return a list of standard suggestions for `read-regexp'. |
| 811 | By default, the list includes the \"tag\" at point (see Info | 811 | By default, the list includes the identifier (a.k.a. \"tag\") |
| 812 | node `(emacs) Identifier Search'), the last isearch regexp, the | 812 | at point (see Info node `(emacs) Identifier Search'), the last |
| 813 | last isearch string, and the last replacement regexp. | 813 | isearch regexp, the last isearch string, and the last |
| 814 | `read-regexp' appends the list returned by this function to the | 814 | replacement regexp. `read-regexp' appends the list returned |
| 815 | end of values available via | 815 | by this function to the end of values available via |
| 816 | \\<minibuffer-local-map>\\[next-history-element]." | 816 | \\<minibuffer-local-map>\\[next-history-element]." |
| 817 | (list | 817 | (list |
| 818 | (find-tag-default-as-regexp) | 818 | (find-tag-default-as-regexp) |
| @@ -827,33 +827,35 @@ Prompt with the string PROMPT. If PROMPT ends in \":\" (followed by | |||
| 827 | optional whitespace), use it as-is. Otherwise, add \": \" to the end, | 827 | optional whitespace), use it as-is. Otherwise, add \": \" to the end, |
| 828 | possibly preceded by the default result (see below). | 828 | possibly preceded by the default result (see below). |
| 829 | 829 | ||
| 830 | The optional argument DEFAULTS can be either: nil, a string, a list | 830 | The optional argument DEFAULTS is used to construct the default |
| 831 | of strings, or a symbol. We use DEFAULTS to construct the default | 831 | return value in case of empty input. DEFAULTS can be nil, a string, |
| 832 | return value in case of empty input. | 832 | a list of strings, or a symbol. |
| 833 | 833 | ||
| 834 | If DEFAULTS is a string, we use it as-is. | 834 | If DEFAULTS is a string, the function uses it as-is. |
| 835 | 835 | ||
| 836 | If DEFAULTS is a list of strings, the first element is the | 836 | If DEFAULTS is a list of strings, the first element is the |
| 837 | default return value, but all the elements are accessible | 837 | default return value, but all the elements are accessible |
| 838 | using the history command \\<minibuffer-local-map>\\[next-history-element]. | 838 | using the history command \\<minibuffer-local-map>\\[next-history-element]. |
| 839 | 839 | ||
| 840 | DEFAULTS can be a symbol. If DEFAULTS is the symbol | 840 | If DEFAULTS is the symbol `regexp-history-last', the default return |
| 841 | `regexp-history-last', we use the first element of HISTORY (if | 841 | value will be the first element of HISTORY. If HISTORY is omitted or |
| 842 | specified) or `regexp-history'. If DEFAULTS is a symbol with a | 842 | nil, `regexp-history' is used instead. |
| 843 | function definition, we call it with no arguments and use what it | 843 | If DEFAULTS is a symbol with a function definition, it is called with |
| 844 | returns, which should be either nil, a string, or a list of | 844 | no arguments and should return either nil, a string, or a list of |
| 845 | strings. Other symbol values for DEFAULTS are ignored. If | 845 | strings, which will be used as above. |
| 846 | `read-regexp-defaults-function' is non-nil, its value is used | 846 | Other symbol values for DEFAULTS are ignored. |
| 847 | instead of DEFAULTS in the two cases described in this paragraph. | ||
| 848 | 847 | ||
| 849 | We append the standard values from `read-regexp-suggestions' to DEFAULTS | 848 | If `read-regexp-defaults-function' is non-nil, its value is used |
| 850 | before using it. | 849 | instead of DEFAULTS in the two cases described in the last paragraph. |
| 850 | |||
| 851 | Before using whatever value DEFAULTS yields, the function appends the | ||
| 852 | standard values from `read-regexp-suggestions' to that value. | ||
| 851 | 853 | ||
| 852 | If the first element of DEFAULTS is non-nil (and if PROMPT does not end | 854 | If the first element of DEFAULTS is non-nil (and if PROMPT does not end |
| 853 | in \":\", followed by optional whitespace), we add it to the prompt. | 855 | in \":\", followed by optional whitespace), DEFAULT is added to the prompt. |
| 854 | 856 | ||
| 855 | The optional argument HISTORY is a symbol to use for the history list. | 857 | The optional argument HISTORY is a symbol to use for the history list. |
| 856 | If nil, uses `regexp-history'." | 858 | If nil, use `regexp-history'." |
| 857 | (let* ((defaults | 859 | (let* ((defaults |
| 858 | (if (and defaults (symbolp defaults)) | 860 | (if (and defaults (symbolp defaults)) |
| 859 | (cond | 861 | (cond |