comparison etc/etags.1 @ 25853:e96ffe544684

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