aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Potortì1999-11-01 19:04:46 +0000
committerFrancesco Potortì1999-11-01 19:04:46 +0000
commit8dc78b523c00e3718da9a4ef028c9f2e6ccfc827 (patch)
treec8387742aee16037beafe120dd4868d23b7d0e8a
parent4a80fa0ccb4b1a5714d19608275b588ebab6c01a (diff)
downloademacs-8dc78b523c00e3718da9a4ef028c9f2e6ccfc827.tar.gz
emacs-8dc78b523c00e3718da9a4ef028c9f2e6ccfc827.zip
Last changes for etags (I hope).
-rw-r--r--etc/NEWS11
-rw-r--r--etc/etags.1113
-rw-r--r--man/programs.texi51
3 files changed, 110 insertions, 65 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 0c30b07658a..cea0444e1c8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -387,10 +387,10 @@ sh-script can attempt to "learn" the current buffer's style.
387*** In DOS, etags looks for file.cgz if it cannot find file.c. 387*** In DOS, etags looks for file.cgz if it cannot find file.c.
388 388
389*** New option --ignore-case-regex is an alternative to --regex. It is now 389*** New option --ignore-case-regex is an alternative to --regex. It is now
390 possible to bind a regexp to a language, by prepending the regexp with 390possible to bind a regexp to a language, by prepending the regexp with
391 {lang}, where lang is one of the languages that `etags --help' prints 391{lang}, where lang is one of the languages that `etags --help' prints out.
392 out. This feature is useful especially for regex files, where each 392This feature is useful especially for regex files, where each line contains
393 line contains a regular expression. The manual contains details. 393a regular expression. The manual contains details.
394 394
395*** In C and derived languages, etags creates tags for function 395*** In C and derived languages, etags creates tags for function
396declarations when given the --declarations option. 396declarations when given the --declarations option.
@@ -413,7 +413,8 @@ variables are tagged.
413 413
414*** New language Python: def and class at the beginning of a line are tags. 414*** New language Python: def and class at the beginning of a line are tags.
415 415
416*** .ss files are Scheme files. 416*** .ss files are Scheme files, .pdb is Postscript with C syntax, .psw is
417for PSWrap.
417 418
418** Emacs now attempts to determine the initial language environment 419** Emacs now attempts to determine the initial language environment
419and preferred and locale coding systems systematically from the 420and preferred and locale coding systems systematically from the
diff --git a/etc/etags.1 b/etc/etags.1
index 20febe24c2f..20d2a10b44f 100644
--- a/etc/etags.1
+++ b/etc/etags.1
@@ -1,6 +1,6 @@
1.\" Copyright (c) 1992 Free Software Foundation 1.\" Copyright (c) 1992 Free Software Foundation
2.\" See section COPYING for conditions for redistribution 2.\" See section COPYING for conditions for redistribution
3.TH etags 1 "19apr1994" "GNU Tools" "GNU Tools" 3.TH etags 1 "02nov1999" "GNU Tools" "GNU Tools"
4.de BP 4.de BP
5.sp 5.sp
6.ti -.2i 6.ti -.2i
@@ -12,24 +12,31 @@ etags, ctags \- generate tag file for Emacs, vi
12.SH SYNOPSIS 12.SH SYNOPSIS
13.hy 0 13.hy 0
14.na 14.na
15.B etags [\|\-aCDRSVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] 15.B etags [\|\-aCDGImRVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|]
16.br 16.if n .br
17[\|\-\-c++\|] [\|\-\-no\-defines\|] [\|\-\-ignore\-indentation\|] 17.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|]
18[\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] 18.br
19[\|\-\-no\-regexp\|] [\|\-\-help\|] [\|\-\-version\|] 19[\|\-\-append\|] [\|\-\-c++\|] [\|\-\-no\-defines\|]
20[\|\-\-include=\fIfile\fP\|] [\|\-\-output=\fItagfile\fP\|] 20[\|\-\-no\-globals\|] [\|\-\-include=\fIfile\fP\|]
21[\|\-\-append\|] \fIfile\fP .\|.\|. 21[\|\-\-ignore\-indentation\|] [\|\-\-language=\fIlanguage\fP\|]
22[\|\-\-members\|] [\|\-\-output=\fItagfile\fP\|]
23[\|\-\-regex=\fIregexp\fP\|] [\|\-\-no\-regex\|]
24[\|\-\-help\|] [\|\-\-version\|]
25\fIfile\fP .\|.\|.
22 26
23.B ctags [\|\-aCdRSVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] 27.B ctags [\|\-aCdgImRVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|]
24.br 28.if n .br
25[\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] 29.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|]
26[\|\-\-c++\|] [\|\-\-defines\|] [\|\-\-ignore\-indentation\|] 30.br
27[\|\-\-no\-warn\|] [\|\-\-cxref\|] [\|\-\-backward\-search\|] 31[\|\-\-append\|] [\|\-\-backward\-search\|] [\|\-\-c++\|]
28[\|\-\-forward\-search\|] [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] 32[\|\-\-cxref\|] [\|\-\-defines\|] [\|\-\-forward\-search\|]
29[\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] 33[\|\-\-globals\|] [\|\-\-ignore\-indentation\|]
34[\|\-\-language=\fIlanguage\fP\|] [\|\-\-members\|]
35[\|\-\-output=\fItagfile\fP\|] [\|\-\-regex=\fIregexp\fP\|]
36[\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|]
37[\|\-\-update\|] [\|\-\-no\-warn\|]
30[\|\-\-help\|] [\|\-\-version\|] 38[\|\-\-help\|] [\|\-\-version\|]
31.br 39\fIfile\fP .\|.\|.
32[\|\-\-output=\fItagfile\fP\|] [\|\-\-append\|] [\|\-\-update\|] \fIfile\fP .\|.\|.
33.ad b 40.ad b
34.hy 1 41.hy 1
35.SH DESCRIPTION 42.SH DESCRIPTION
@@ -40,8 +47,9 @@ understood by
40format understood by 47format understood by
41.BR vi ( 1 )\c 48.BR vi ( 1 )\c
42\&. Both forms of the program understand 49\&. Both forms of the program understand
43the syntax of C, C++, Fortran, Pascal, LaTeX, Scheme, 50the syntax of C, Objective C, C++, Java, Fortran, Pascal, Cobol, Ada, Perl,
44Emacs Lisp/Common Lisp, Erlang, Prolog and most assembler\-like syntaxes. 51LaTeX, Scheme, Emacs Lisp/Common Lisp, Postscript, Erlang, Python, Prolog and
52most assembler\-like syntaxes.
45Both forms read the files specified on the command line, and write a tag 53Both forms read the files specified on the command line, and write a tag
46table (defaults: `\|TAGS\|' for \fBetags\fP, `\|tags\|' for 54table (defaults: `\|TAGS\|' for \fBetags\fP, `\|tags\|' for
47\fBctags\fP) in the current working directory. 55\fBctags\fP) in the current working directory.
@@ -76,16 +84,39 @@ Treat files with `\|.c\|' and `\|.h\|' extensions as C++ code, not C
76code. Files with `\|.C\|', `\|.H\|', `\|.cxx\|', `\|.hxx\|', or 84code. Files with `\|.C\|', `\|.H\|', `\|.cxx\|', `\|.hxx\|', or
77`\|.cc\|' extensions are always assumed to be C++ code. 85`\|.cc\|' extensions are always assumed to be C++ code.
78.TP 86.TP
87.B \-\-declarations
88In C and derived languages, create tags for function declarations,
89and create tags for extern variables unless \-\-no\-globals is used.
90.TP
79.B \-d, \-\-defines 91.B \-d, \-\-defines
80Create tag entries for C preprocessor definitions, too. This is the 92Create tag entries for C preprocessor constant definitions
81default behavior for \fBetags\fP, so this option is only accepted 93and enum constants, too. This is the
82by \fBctags\fP. 94default behavior for \fBetags\fP.
83.TP 95.TP
84.B \-D, \-\-no\-defines 96.B \-D, \-\-no\-defines
85Do not create tag entries for C preprocessor definitions. 97Do not create tag entries for C preprocessor constant definitions
98and enum constants.
86This may make the tags file much smaller if many header files are tagged. 99This may make the tags file much smaller if many header files are tagged.
87This is the default behavior for \fBctags\fP, so this option is only 100This is the default behavior for \fBctags\fP.
88accepted by \fBetags\fP. 101.TP
102.B \-g, \-\-globals
103Create tag entries for global variables in C, C++, Objective C, Java,
104and Perl.
105This is the default behavior for \fBetags\fP.
106.TP
107.B \-G, \-\-no\-globals
108Do not tag global variables. Typically this reduces the file size by
109one fourth. This is the default behavior for \fBctags\fP.
110.TP
111\fB\-i\fP \fIfile\fP, \fB\-\-include=\fIfile\fP
112Include a note in the tag file indicating that, when searching for a
113tag, one should also consult the tags file \fIfile\fP after checking the
114current file. This options is only accepted by \fBetags\fP.
115.TP
116.B \-I, \-\-ignore\-indentation
117Don't rely on indentation as much as we normally do. Currently, this
118means not to assume that a closing brace in the first column is the
119final brace of a function or structure definition in C and C++.
89.TP 120.TP
90\fB\-l\fP \fIlanguage\fP, \fB\-\-language=\fIlanguage\fP 121\fB\-l\fP \fIlanguage\fP, \fB\-\-language=\fIlanguage\fP
91Parse the following files according to the given language. More than 122Parse the following files according to the given language. More than
@@ -96,6 +127,16 @@ detection of language based on filename extension. The `none'
96language may be used to disable language parsing altogether; only 127language may be used to disable language parsing altogether; only
97regexp matching is done in this case (see the \fB\-\-regex\fP option). 128regexp matching is done in this case (see the \fB\-\-regex\fP option).
98.TP 129.TP
130.B \-m, \-\-members
131Create tag entries for variables that are members of structure-like
132constructs in C++, Objective C, Java.
133.TP
134.B \-M, \-\-no\-members
135Do not tag member variables. This is the default behavior.
136.TP
137.B \-\-packages\-only
138Only tag packages in Ada files.
139.TP
99\fB\-o\fP \fItagfile\fP, \fB\-\-output=\fItagfile\fP 140\fB\-o\fP \fItagfile\fP, \fB\-\-output=\fItagfile\fP
100Explicit name of file for tag table; overrides default `\|TAGS\|' or 141Explicit name of file for tag table; overrides default `\|TAGS\|' or
101`\|tags\|'. (But ignored with \fB\-v\fP or \fB\-x\fP.) 142`\|tags\|'. (But ignored with \fB\-v\fP or \fB\-x\fP.)
@@ -116,7 +157,8 @@ It should not match useless characters. If the match is
116such that more characters than needed are unavoidably matched by 157such that more characters than needed are unavoidably matched by
117\fItagregexp\fP, it may be useful to add a \fInameregexp\fP, to 158\fItagregexp\fP, it may be useful to add a \fInameregexp\fP, to
118narrow down the tag scope. \fBctags\fP ignores regexps without a 159narrow down the tag scope. \fBctags\fP ignores regexps without a
119\fInameregexp\fP. 160\fInameregexp\fP. The syntax of regexps is the same as in emacs,
161augmented with intervals of the form \\{m,n\\}, as in ed or grep.
120.br 162.br
121Here are some examples. All the regexps are quoted to protect them 163Here are some examples. All the regexps are quoted to protect them
122from shell interpretation. 164from shell interpretation.
@@ -136,16 +178,6 @@ CONFIGURATION\\)\ +[^\ ]*\ +OF/'\ \-\-regex\='/[\ \\t]*\\
136\\|PROCEDURE\\|PROCESS\\|TYPE\\)[\ \\t]+\\([^\ \\t(]+\\)/\\3/'\fP 178\\|PROCEDURE\\|PROCESS\\|TYPE\\)[\ \\t]+\\([^\ \\t(]+\\)/\\3/'\fP
137.br 179.br
138 180
139Tag Cobol files:
140.br
141\fI\-\-language\=none \-\-regex\='/.......[a\-zA\-Z0\-9\-]+\\./'\fP
142.br
143
144Tag Postscript files:
145.br
146\fI\-\-language\=none \-\-regex\='#/[^\ \\t{]+#/'\fP
147.br
148
149Tag TCL files (this last example shows the usage of a \fItagregexp\fP): 181Tag TCL files (this last example shows the usage of a \fItagregexp\fP):
150.br 182.br
151\fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP 183\fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP
@@ -155,11 +187,6 @@ Tag TCL files (this last example shows the usage of a \fItagregexp\fP):
155Don't do any more regexp matching on the following files. May be 187Don't do any more regexp matching on the following files. May be
156freely intermixed with filenames and the \fB\-\-regex\fP option. 188freely intermixed with filenames and the \fB\-\-regex\fP option.
157.TP 189.TP
158.B \-S, \-\-ignore\-indentation
159Don't rely on indentation as much as we normally do. Currently, this
160means not to assume that a closing brace in the first column is the
161final brace of a function or structure definition in C and C++.
162.TP
163.B \-t, \-\-typedefs 190.B \-t, \-\-typedefs
164Record typedefs in C code as tags. Since this is the default behaviour 191Record typedefs in C code as tags. Since this is the default behaviour
165of \fBetags\fP, only \fBctags\fP accepts this option. 192of \fBetags\fP, only \fBctags\fP accepts this option.
@@ -190,7 +217,7 @@ allowed with it.
190Instead of generating a tag file, write a cross reference (in 217Instead of generating a tag file, write a cross reference (in
191\fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option. 218\fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option.
192.TP 219.TP
193.B \-H, \-\-help 220.B \-h, \-H, \-\-help
194Print usage information. 221Print usage information.
195.TP 222.TP
196.B \-V, \-\-version 223.B \-V, \-\-version
@@ -207,7 +234,7 @@ Stallman.
207.BR vi ( 1 ). 234.BR vi ( 1 ).
208 235
209.SH COPYING 236.SH COPYING
210Copyright (c) 1992 Free Software Foundation, Inc. 237Copyright (c) 1999 Free Software Foundation, Inc.
211.PP 238.PP
212Permission is granted to make and distribute verbatim copies of 239Permission is granted to make and distribute verbatim copies of
213this manual provided the copyright notice and this permission notice 240this manual provided the copyright notice and this permission notice
diff --git a/man/programs.texi b/man/programs.texi
index 68057d81a25..e2f6badbafc 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -1620,13 +1620,13 @@ recorded is called a @dfn{tag}.
1620@item 1620@item
1621In C code, any C function or typedef is a tag, and so are definitions of 1621In C code, any C function or typedef is a tag, and so are definitions of
1622@code{struct}, @code{union} and @code{enum}. You can tag function 1622@code{struct}, @code{union} and @code{enum}. You can tag function
1623declarations in addition to function definitions by giving the 1623declarations and external variables in addition to function definitions
1624@samp{--declarations} option to @code{etags}. @code{#define} macro 1624by giving the @samp{--declarations} option to @code{etags}.
1625definitions and @code{enum} constants are also tags, unless you specify 1625@code{#define} macro definitions and @code{enum} constants are also
1626@samp{--no-defines} when making the tags table. Similarly, global 1626tags, unless you specify @samp{--no-defines} when making the tags table.
1627variables are tags, unless you specify @samp{--no-globals}. Use of 1627Similarly, global variables are tags, unless you specify
1628@samp{--no-globals} and @samp{--no-defines} can make the tags table file 1628@samp{--no-globals}. Use of @samp{--no-globals} and @samp{--no-defines}
1629much smaller. 1629can make the tags table file much smaller.
1630 1630
1631@item 1631@item
1632In C++ code, in addition to all the tag constructs of C code, member 1632In C++ code, in addition to all the tag constructs of C code, member
@@ -1680,7 +1680,9 @@ set with @code{set!} at top level in the file.
1680@itemize @bullet 1680@itemize @bullet
1681 1681
1682@item 1682@item
1683In Ada code, functions, procedures, packages, tasks, and types are tags. 1683In Ada code, functions, procedures, packages, tasks, and types are
1684tags. Use the @samp{--packages-only} option to create tags for packages
1685only.
1684 1686
1685@item 1687@item
1686In assembler code, labels appearing at the beginning of a line, 1688In assembler code, labels appearing at the beginning of a line,
@@ -1720,11 +1722,11 @@ In Postscript code, the tags are the functions.
1720 1722
1721@item 1723@item
1722In Prolog code, a tag name appears at the left margin. 1724In Prolog code, a tag name appears at the left margin.
1723@end itemize
1724 1725
1725@item 1726@item
1726In Python code, @code{def} or @code{class} at the beginning of a line 1727In Python code, @code{def} or @code{class} at the beginning of a line
1727generate a tag. 1728generate a tag.
1729@end itemize
1728 1730
1729 You can also generate tags based on regexp matching (@pxref{Using 1731 You can also generate tags based on regexp matching (@pxref{Using
1730Regexps}) to handle other formats and languages. 1732Regexps}) to handle other formats and languages.
@@ -1930,21 +1932,36 @@ from shell interpretation.
1930@itemize @bullet 1932@itemize @bullet
1931 1933
1932@item 1934@item
1933Tag VHDL files (this example is a single long line, broken here for 1935Tag Octave files:
1934formatting reasons):
1935 1936
1936@smallexample 1937@smallexample
1937--language=none 1938etags --language=none \
1938--regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' 1939 --regex='/[ \t]*function.*=[ \t]*\([^ \t]*\)[ \t]*(/\1/' \
1939--regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\ 1940 --regex='/###key \(.*\)/\1/' \
1940\( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/' 1941 --regex='/[ \t]*global[ \t].*/' \
1942 *.m
1941@end smallexample 1943@end smallexample
1942 1944
1945@noindent
1946Note that tags are not generated for scripts so that you have to add a
1947line by yourself of the form `###key <script-name>' if you want to jump
1948to it.
1949
1943@item 1950@item
1944Tag Tcl files (this last example shows the usage of a @var{nameregexp}): 1951Tag Tcl files:
1945 1952
1946@smallexample 1953@smallexample
1947--lang=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' 1954etags --language=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' *.tcl
1955@end smallexample
1956
1957@item
1958Tag VHDL files:
1959
1960@smallexample
1961--language=none \
1962--regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' \
1963--regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\
1964\( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/'
1948@end smallexample 1965@end smallexample
1949@end itemize 1966@end itemize
1950 1967