aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2021-01-27 17:15:46 +0200
committerEli Zaretskii2021-01-27 17:15:46 +0200
commit49eb03d6c8a181fd46adbbcf1f0a976d0a9efa87 (patch)
tree7972e6e78e4ea78ff02d035d6a323a6b987901f7
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)
-rw-r--r--doc/emacs/glossary.texi8
-rw-r--r--doc/emacs/maintaining.texi22
-rw-r--r--lisp/replace.el44
3 files changed, 41 insertions, 33 deletions
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index 35df06591eb..4f971eb1e01 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -1369,10 +1369,14 @@ configurations. @xref{Tab Bars}.
1369The tab line is a line of tabs at the top of an Emacs window. 1369The tab line is a line of tabs at the top of an Emacs window.
1370Clicking on one of these tabs switches window buffers. @xref{Tab Line}. 1370Clicking on one of these tabs switches window buffers. @xref{Tab Line}.
1371 1371
1372@item Tag
1373A tag is an identifier in a program source. @xref{Xref}.
1374
1372@anchor{Glossary---Tags Table} 1375@anchor{Glossary---Tags Table}
1373@item Tags Table 1376@item Tags Table
1374A tags table is a file that serves as an index to the function 1377A tags table is a file that serves as an index to identifiers: definitions
1375definitions in one or more other files. @xref{Tags Tables}. 1378of functions, macros, data structures, etc., in one or more other files.
1379@xref{Tags Tables}.
1376 1380
1377@item Termscript File 1381@item Termscript File
1378A termscript file contains a record of all characters sent by Emacs to 1382A termscript file contains a record of all characters sent by Emacs to
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 415815473e5..bc276c49046 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1994,19 +1994,21 @@ Of course, you should substitute the proper years and copyright holder.
1994@section Find Identifier References 1994@section Find Identifier References
1995@cindex xref 1995@cindex xref
1996 1996
1997@cindex tag
1997 An @dfn{identifier} is a name of a syntactical subunit of the 1998 An @dfn{identifier} is a name of a syntactical subunit of the
1998program: a function, a subroutine, a method, a class, a data type, a 1999program: a function, a subroutine, a method, a class, a data type, a
1999macro, etc. In a programming language, each identifier is a symbol in 2000macro, etc. In a programming language, each identifier is a symbol in
2000the language's syntax. Program development and maintenance requires 2001the language's syntax. Identifiers are also known as @dfn{tags}.
2001capabilities to quickly find where each identifier was defined and 2002
2002referenced, to rename identifiers across the entire project, etc. 2003Program development and maintenance requires capabilities to quickly
2003 2004find where each identifier was defined and referenced, to rename
2004These capabilities are also useful for finding references in major 2005identifiers across the entire project, etc. These capabilities are
2005modes other than those defined to support programming languages. For 2006also useful for finding references in major modes other than those
2006example, chapters, sections, appendices, etc.@: of a text or a @TeX{} 2007defined to support programming languages. For example, chapters,
2007document can be treated as subunits as well, and their names can be 2008sections, appendices, etc.@: of a text or a @TeX{} document can be
2008used as identifiers. In this chapter, we use the term ``identifiers'' 2009treated as subunits as well, and their names can be used as
2009to collectively refer to the names of any kind of subunits, in program 2010identifiers. In this chapter, we use the term ``identifiers'' to
2011collectively refer to the names of any kind of subunits, in program
2010source and in other kinds of text alike. 2012source and in other kinds of text alike.
2011 2013
2012Emacs provides a unified interface to these capabilities, called 2014Emacs provides a unified interface to these capabilities, called
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