aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorEli Zaretskii2021-01-27 17:15:46 +0200
committerEli Zaretskii2021-01-27 17:15:46 +0200
commit49eb03d6c8a181fd46adbbcf1f0a976d0a9efa87 (patch)
tree7972e6e78e4ea78ff02d035d6a323a6b987901f7 /lisp/replace.el
parent08574a7f40f27ad29efb8f7d975012ecc9111717 (diff)
downloademacs-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.el44
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'.
811By default, the list includes the \"tag\" at point (see Info 811By default, the list includes the identifier (a.k.a. \"tag\")
812node `(emacs) Identifier Search'), the last isearch regexp, the 812at point (see Info node `(emacs) Identifier Search'), the last
813last isearch string, and the last replacement regexp. 813isearch regexp, the last isearch string, and the last
814`read-regexp' appends the list returned by this function to the 814replacement regexp. `read-regexp' appends the list returned
815end of values available via 815by 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
827optional whitespace), use it as-is. Otherwise, add \": \" to the end, 827optional whitespace), use it as-is. Otherwise, add \": \" to the end,
828possibly preceded by the default result (see below). 828possibly preceded by the default result (see below).
829 829
830The optional argument DEFAULTS can be either: nil, a string, a list 830The optional argument DEFAULTS is used to construct the default
831of strings, or a symbol. We use DEFAULTS to construct the default 831return value in case of empty input. DEFAULTS can be nil, a string,
832return value in case of empty input. 832a list of strings, or a symbol.
833 833
834If DEFAULTS is a string, we use it as-is. 834If DEFAULTS is a string, the function uses it as-is.
835 835
836If DEFAULTS is a list of strings, the first element is the 836If DEFAULTS is a list of strings, the first element is the
837default return value, but all the elements are accessible 837default return value, but all the elements are accessible
838using the history command \\<minibuffer-local-map>\\[next-history-element]. 838using the history command \\<minibuffer-local-map>\\[next-history-element].
839 839
840DEFAULTS can be a symbol. If DEFAULTS is the symbol 840If DEFAULTS is the symbol `regexp-history-last', the default return
841`regexp-history-last', we use the first element of HISTORY (if 841value will be the first element of HISTORY. If HISTORY is omitted or
842specified) or `regexp-history'. If DEFAULTS is a symbol with a 842nil, `regexp-history' is used instead.
843function definition, we call it with no arguments and use what it 843If DEFAULTS is a symbol with a function definition, it is called with
844returns, which should be either nil, a string, or a list of 844no arguments and should return either nil, a string, or a list of
845strings. Other symbol values for DEFAULTS are ignored. If 845strings, which will be used as above.
846`read-regexp-defaults-function' is non-nil, its value is used 846Other symbol values for DEFAULTS are ignored.
847instead of DEFAULTS in the two cases described in this paragraph.
848 847
849We append the standard values from `read-regexp-suggestions' to DEFAULTS 848If `read-regexp-defaults-function' is non-nil, its value is used
850before using it. 849instead of DEFAULTS in the two cases described in the last paragraph.
850
851Before using whatever value DEFAULTS yields, the function appends the
852standard values from `read-regexp-suggestions' to that value.
851 853
852If the first element of DEFAULTS is non-nil (and if PROMPT does not end 854If the first element of DEFAULTS is non-nil (and if PROMPT does not end
853in \":\", followed by optional whitespace), we add it to the prompt. 855in \":\", followed by optional whitespace), DEFAULT is added to the prompt.
854 856
855The optional argument HISTORY is a symbol to use for the history list. 857The optional argument HISTORY is a symbol to use for the history list.
856If nil, uses `regexp-history'." 858If 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