0
|
1 .\" Copyright (c) 1992 Free Software Foundation
|
|
2 .\" See section COPYING for conditions for redistribution
|
|
3 .TH etags 1 "19apr1994" "GNU Tools" "GNU Tools"
|
|
4 .de BP
|
|
5 .sp
|
|
6 .ti -.2i
|
|
7 \(**
|
|
8 ..
|
|
9
|
|
10 .SH NAME
|
|
11 etags -- generate tag file for Emacs
|
|
12 .br
|
|
13 ctags -- generate tag file for vi
|
|
14 .SH SYNOPSIS
|
|
15 .hy 0
|
|
16 .na
|
|
17 .B etags [\|\-aCDRSVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|]
|
|
18 .br
|
|
19 [\|\-\-c++\|] [\|\-\-no\-defines\|] [\|\-\-ignore\-indentation\|]
|
|
20 [\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|]
|
|
21 [\|\-\-no\-regexp\|] [\|\-\-help\|] [\|\-\-version\|]
|
|
22 [\|\-\-include=\fIfile\fP\|] [\|\-\-output=\fItagfile\fP\|]
|
|
23 [\|\-\-append\|] \fIfile\fP .\|.\|.
|
|
24
|
|
25 .B ctags [\|\-aCdRSVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|]
|
|
26 .br
|
|
27 [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|]
|
|
28 [\|\-\-c++\|] [\|\-\-defines\|] [\|\-\-ignore\-indentation\|]
|
|
29 [\|\-\-no\-warn\|] [\|\-\-cxref\|] [\|\-\-backward\-search\|]
|
|
30 [\|\-\-forward\-search\|] [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|]
|
|
31 [\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|]
|
|
32 [\|\-\-help\|] [\|\-\-version\|]
|
|
33 .br
|
|
34 [\|\-\-output=\fItagfile\fP\|] [\|\-\-append\|] [\|\-\-update\|] \fIfile\fP .\|.\|.
|
|
35 .ad b
|
|
36 .hy 1
|
|
37 .SH DESCRIPTION
|
|
38 The `\|\fBetags\fP\|' program is used to create a tag table file, in a format
|
|
39 understood by
|
|
40 .BR emacs ( 1 )\c
|
|
41 \&; the `\|\fBctags\fP\|' program is used to create a similar table in a
|
|
42 format understood by
|
|
43 .BR vi ( 1 )\c
|
|
44 \&. Both forms of the program understand
|
|
45 the syntax of C, C++, Fortran, Pascal, LaTeX, Scheme, Emacs Lisp/Common Lisp
|
|
46 and most assembler\-like syntaxes.
|
|
47 Both forms read the files specified on the command line, and write a tag
|
|
48 table (defaults: `\|TAGS\|' for \fBetags\fP, `\|tags\|' for
|
|
49 \fBctags\fP) in the current working directory.
|
|
50 The programs recognize the language used in an input file based on its
|
|
51 file name and contents. The --language switch can be used to force
|
|
52 parsing of the file names following the switch according to the given
|
|
53 language, overriding guesses based on filename extensions.
|
|
54 .SH OPTIONS
|
|
55 Some options make sense only for the \fBvi\fP style tag files produced
|
|
56 by ctags;
|
|
57 \fBetags\fP does not recognize them.
|
|
58 The programs accept unambiguous abbreviations for long option names.
|
|
59 .TP
|
|
60 .B \-a, \-\-append
|
|
61 Append to existing tag file. (For vi-format tag files, see also
|
|
62 \fB\-\-update\fP.)
|
|
63 .TP
|
|
64 .B \-B, \-\-backward\-search
|
|
65 Tag files written in the format expected by \fBvi\fP contain regular
|
|
66 expression search instructions; the \fB\-B\fP option writes them using
|
|
67 the delimiter `\|\fB?\fP\|', to search \fIbackwards\fP through files.
|
|
68 The default is to use the delimiter `\|\fB/\fP\|', to search \fIforwards\fP
|
|
69 through files.
|
|
70 Only \fBctags\fP accepts this option.
|
|
71 .TP
|
|
72 .B \-C, \-\-c++
|
|
73 Treat files with `\|.c\|' and `\|.h\|' extensions as C++ code, not C
|
|
74 code. Files with `\|.C\|', `\|.H\|', `\|.cxx\|', `\|.hxx\|', or
|
|
75 `\|.cc\|' extensions are always assumed to be C++ code.
|
|
76 .TP
|
|
77 .B \-d, \-\-defines
|
|
78 Create tag entries for C preprocessor definitions, too. This is the
|
|
79 default behavior for \fBetags\fP, so this option is only accepted
|
|
80 by \fBctags\fP.
|
|
81 .TP
|
|
82 .B \-D, \-\-no\-defines
|
|
83 Do not create tag entries for C preprocessor definitions.
|
|
84 This may make the tags file much smaller if many header files are tagged.
|
|
85 This is the default behavior for \fBctags\fP, so this option is only
|
|
86 accepted by \fBetags\fP.
|
|
87 .TP
|
|
88 \fB\-l\fP \fIlanguage\fP, \fB\-\-language=\fIlanguage\fP
|
|
89 Parse the following files according to the given language. More than
|
|
90 one such options may be intermixed with filenames. Use \fB\-\-help\fP
|
|
91 to get a list of the available languages and their default filename
|
|
92 extensions. The `auto' language can be used to restore automatic
|
|
93 detection of language based on filename extension. The `none'
|
|
94 language may be used to disable language parsing altogether; only
|
|
95 regexp matching is done in this case (see the \fB\-\-regex\fP option).
|
|
96 .TP
|
|
97 \fB\-o\fP \fItagfile\fP, \fB\-\-output=\fItagfile\fP
|
|
98 Explicit name of file for tag table; overrides default `\|TAGS\|' or
|
|
99 `\|tags\|'. (But ignored with \fB\-v\fP or \fB\-x\fP.)
|
|
100 .TP
|
|
101 \fB\-r\fP \fIregexp\fP, \fB\-\-regex=\fIregexp\fP
|
|
102 Make tags based on regexp matching for each line of the files
|
|
103 following this option, in addition to the tags made with the standard
|
|
104 parsing based on language. May be freely intermixed with filenames
|
|
105 and the \fB\-R\fP option. The regexps are cumulative, i.e. each
|
|
106 option will add to the previous ones. The regexps are of the form:
|
|
107 .br
|
|
108
|
|
109 \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP
|
|
110 .br
|
|
111
|
|
112 where \fItagregexp\fP is used to match the lines that must be tagged.
|
|
113 It should not match useless characters. If the match is
|
|
114 such that more characters than needed are unavoidably matched by
|
|
115 \fItagregexp\fP, it may be useful to add a \fInameregexp\fP, to
|
|
116 narrow down the tag scope.
|
|
117 .br
|
|
118 Here are some examples. All the regexps are quoted to protect them
|
|
119 from shell interpretation.
|
|
120 .br
|
|
121
|
|
122 Tag the DEFVAR macros in the emacs source files:
|
|
123 .br
|
|
124 \fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"\/'\fP
|
|
125 .br
|
|
126
|
|
127 Tag VHDL files (this example is a single long line, broken here for
|
|
128 formatting reasons):
|
|
129 .br
|
|
130 \fI\-\-language\=none\ \-\-regex='/[\ \\t]*\\(ARCHITECTURE\\|\\
|
|
131 CONFIGURATION\\)\ +[^\ ]*\ +OF/'\ \-\-regex\='/[\ \\t]*\\
|
|
132 \\(ATTRIBUTE\\|ENTITY\\|FUNCTION\\|PACKAGE\\(\ BODY\\)?\\
|
|
133 \\|PROCEDURE\\|PROCESS\\|TYPE\\)[\ \\t]+\\([^\ \\t(]+\\)/\\3/'\fP
|
|
134 .br
|
|
135
|
|
136 Tag Cobol files:
|
|
137 .br
|
|
138 \fI\-\-language\=none \-\-regex\='/.......[a\-zA\-Z0\-9\-]+\\./'\fP
|
|
139 .br
|
|
140
|
|
141 Tag Postscript files:
|
|
142 .br
|
|
143 \fI\-\-language\=none \-\-regex\='#/[^\ \\t{]+#/'\fP
|
|
144 .br
|
|
145
|
|
146 Tag TCL files (this last example shows the usage of a \fItagregexp\fP):
|
|
147 .br
|
|
148 \fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP
|
|
149
|
|
150 .TP
|
|
151 .B \-R, \-\-no\-regex
|
|
152 Don't do any more regexp matching on the following files. May be
|
|
153 freely intermixed with filenames and the \fB\-\-regex\fP option.
|
|
154 .TP
|
|
155 .B \-S, \-\-ignore\-indentation
|
|
156 Don't rely on indentation as much as we normally do. Currently, this
|
|
157 means not to assume that a closing brace in the first column is the
|
|
158 final brace of a function or structure definition in C and C++.
|
|
159 .TP
|
|
160 .B \-t, \-\-typedefs
|
|
161 Record typedefs in C code as tags. Since this is the default behaviour
|
|
162 of \fBetags\fP, only \fBctags\fP accepts this option.
|
|
163 .TP
|
|
164 .B \-T, \-\-typedefs\-and\-c++
|
|
165 Generate tag entries for typedefs, struct, enum, and union tags, and
|
|
166 C++ member functions. Since this is the default behaviour
|
|
167 of \fBetags\fP, only \fBctags\fP accepts this option.
|
|
168 .TP
|
|
169 .B \-u, \-\-update
|
|
170 Update tag entries for \fIfiles\fP specified on command line, leaving
|
|
171 tag entries for other files in place. Currently, this is implemented
|
|
172 by deleting the existing entries for the given files and then
|
|
173 rewriting the new entries at the end of the tags file. It is often
|
|
174 faster to simply rebuild the entire tag file than to use this.
|
|
175 Only \fBctags\fP accepts this option.
|
|
176 .TP
|
|
177 .B \-v, \-\-vgrind
|
|
178 Instead of generating a tag file, write index (in \fBvgrind\fP format)
|
|
179 to standard output. Only \fBctags\fP accepts this option.
|
|
180 .TP
|
|
181 .B \-w, \-\-no\-warn
|
|
182 Suppress warning messages about duplicate entries. The \fBetags\fP
|
|
183 program does not check for duplicate entries, so this option is not
|
|
184 allowed with it.
|
|
185 .TP
|
|
186 .B \-x, \-\-cxref
|
|
187 Instead of generating a tag file, write a cross reference (in
|
|
188 \fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option.
|
|
189 .TP
|
|
190 .B \-H, \-\-help
|
|
191 Print usage information.
|
|
192 .TP
|
|
193 .B \-V, \-\-version
|
|
194 Print the current version of the program (same as the version of the
|
|
195 emacs \fBetags\fP is shipped with).
|
|
196
|
|
197 .SH "SEE ALSO"
|
|
198 `\|\fBemacs\fP\|' entry in \fBinfo\fP; \fIGNU Emacs Manual\fP, Richard
|
|
199 Stallman.
|
|
200 .br
|
|
201 .BR cxref ( 1 ),
|
|
202 .BR emacs ( 1 ),
|
|
203 .BR vgrind ( 1 ),
|
|
204 .BR vi ( 1 ).
|
|
205
|
|
206 .SH COPYING
|
|
207 Copyright (c) 1992 Free Software Foundation, Inc.
|
|
208 .PP
|
|
209 Permission is granted to make and distribute verbatim copies of
|
|
210 this manual provided the copyright notice and this permission notice
|
|
211 are preserved on all copies.
|
|
212 .PP
|
|
213 Permission is granted to copy and distribute modified versions of this
|
|
214 manual under the conditions for verbatim copying, provided that the
|
|
215 entire resulting derived work is distributed under the terms of a
|
|
216 permission notice identical to this one.
|
|
217 .PP
|
|
218 Permission is granted to copy and distribute translations of this
|
|
219 manual into another language, under the above conditions for modified
|
|
220 versions, except that this permission notice may be included in
|
|
221 translations approved by the Free Software Foundation instead of in
|
|
222 the original English.
|