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