Improve documentation of etags

* doc/emacs/maintaining.texi (Tag Syntax, Create Tags Table):
Improve documentation of etags options and of source language
detection.
This commit is contained in:
Eli Zaretskii 2018-01-11 19:44:29 +02:00
parent 7ba75b9637
commit bd2a2a1e84

View file

@ -2142,10 +2142,13 @@ to function definitions by giving the @samp{--declarations} option to
@item @item
In C++ code, in addition to all the tag constructs of C code, member In C++ code, in addition to all the tag constructs of C code, member
functions are also recognized; member variables are also recognized, functions are also recognized; member variables are also recognized,
unless you use the @samp{--no-members} option. Tags for variables and unless you use the @samp{--no-members} option. @code{operator}
functions in classes are named @samp{@var{class}::@var{variable}} and definitions have tag names like @samp{operator+}. If you specify the
@samp{@var{class}::@var{function}}. @code{operator} definitions have @samp{--class-qualify} option, tags for variables and functions in
tag names like @samp{operator+}. classes are named @samp{@var{class}::@var{variable}} and
@samp{@var{class}::@var{function}}. By default, class methods and
members are not class-qualified, which allows to identify their names in
the sources more accurately.
@item @item
In Java code, tags include all the constructs recognized in C++, plus In Java code, tags include all the constructs recognized in C++, plus
@ -2324,7 +2327,9 @@ The @command{etags} program reads the specified files, and writes a tags
table named @file{TAGS} in the current working directory. You can table named @file{TAGS} in the current working directory. You can
optionally specify a different file name for the tags table by using the optionally specify a different file name for the tags table by using the
@samp{--output=@var{file}} option; specifying @file{-} as a file name @samp{--output=@var{file}} option; specifying @file{-} as a file name
prints the tags table to standard output. prints the tags table to standard output. You can also append the
newly created tags table to an existing file by using the @samp{--append}
option.
If the specified files don't exist, @command{etags} looks for If the specified files don't exist, @command{etags} looks for
compressed versions of them and uncompresses them to read them. Under compressed versions of them and uncompresses them to read them. Under
@ -2381,15 +2386,25 @@ input, by typing a dash in place of the file names, like this:
find . -name "*.[chCH]" -print | etags - find . -name "*.[chCH]" -print | etags -
@end smallexample @end smallexample
@command{etags} recognizes the language used in an input file based @command{etags} recognizes the language used in an input file based on
on its file name and contents. You can specify the language its file name and contents. It first tries to match the file's name and
explicitly with the @samp{--language=@var{name}} option. You can extension to the ones commonly used with certain languages. Some
intermix these options with file names; each one applies to the file languages have interpreters with known names (e.g., @command{perl} for
names that follow it. Specify @samp{--language=auto} to tell Perl or @command{pl} for Prolog), so @command{etags} next looks for an
@command{etags} to resume guessing the language from the file names interpreter specification of the form @samp{#!@var{interp}} on the first
and file contents. Specify @samp{--language=none} to turn off line of an input file, and matches that against known interpreters. If
language-specific processing entirely; then @command{etags} recognizes none of that works, or if you want to override the automatic detection of
tags by regexp matching alone (@pxref{Etags Regexps}). the language, you can specify the language explicitly with the
@samp{--language=@var{name}} option. You can intermix these options with
file names; each one applies to the file names that follow it. Specify
@samp{--language=auto} to tell @command{etags} to resume guessing the
language from the file names and file contents. Specify
@samp{--language=none} to turn off language-specific processing entirely;
then @command{etags} recognizes tags by regexp matching alone
(@pxref{Etags Regexps}). This comes in handy when an input file uses a
language not yet supported by @command{etags}, and you want to avoid
having @command{etags} fall back on Fortran and C as the default
languages.
The option @samp{--parse-stdin=@var{file}} is mostly useful when The option @samp{--parse-stdin=@var{file}} is mostly useful when
calling @command{etags} from programs. It can be used (only once) in calling @command{etags} from programs. It can be used (only once) in