aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2018-01-11 19:44:29 +0200
committerEli Zaretskii2018-01-11 19:44:29 +0200
commitbd2a2a1e84a74b1c7d59dadc9221e667bd54d212 (patch)
treedf1aa923da1e8f08557516b3f18bc7161dc03bd1
parent7ba75b96373024f1f6c9b249f2337d7a58e8094c (diff)
downloademacs-bd2a2a1e84a74b1c7d59dadc9221e667bd54d212.tar.gz
emacs-bd2a2a1e84a74b1c7d59dadc9221e667bd54d212.zip
Improve documentation of etags
* doc/emacs/maintaining.texi (Tag Syntax, Create Tags Table): Improve documentation of etags options and of source language detection.
-rw-r--r--doc/emacs/maintaining.texi43
1 files changed, 29 insertions, 14 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index aba76e501ab..0846440d1de 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -2142,10 +2142,13 @@ to function definitions by giving the @samp{--declarations} option to
2142@item 2142@item
2143In C++ code, in addition to all the tag constructs of C code, member 2143In C++ code, in addition to all the tag constructs of C code, member
2144functions are also recognized; member variables are also recognized, 2144functions are also recognized; member variables are also recognized,
2145unless you use the @samp{--no-members} option. Tags for variables and 2145unless you use the @samp{--no-members} option. @code{operator}
2146functions in classes are named @samp{@var{class}::@var{variable}} and 2146definitions have tag names like @samp{operator+}. If you specify the
2147@samp{@var{class}::@var{function}}. @code{operator} definitions have 2147@samp{--class-qualify} option, tags for variables and functions in
2148tag names like @samp{operator+}. 2148classes are named @samp{@var{class}::@var{variable}} and
2149@samp{@var{class}::@var{function}}. By default, class methods and
2150members are not class-qualified, which allows to identify their names in
2151the sources more accurately.
2149 2152
2150@item 2153@item
2151In Java code, tags include all the constructs recognized in C++, plus 2154In 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
2324table named @file{TAGS} in the current working directory. You can 2327table named @file{TAGS} in the current working directory. You can
2325optionally specify a different file name for the tags table by using the 2328optionally specify a different file name for the tags table by using the
2326@samp{--output=@var{file}} option; specifying @file{-} as a file name 2329@samp{--output=@var{file}} option; specifying @file{-} as a file name
2327prints the tags table to standard output. 2330prints the tags table to standard output. You can also append the
2331newly created tags table to an existing file by using the @samp{--append}
2332option.
2328 2333
2329 If the specified files don't exist, @command{etags} looks for 2334 If the specified files don't exist, @command{etags} looks for
2330compressed versions of them and uncompresses them to read them. Under 2335compressed 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:
2381find . -name "*.[chCH]" -print | etags - 2386find . -name "*.[chCH]" -print | etags -
2382@end smallexample 2387@end smallexample
2383 2388
2384 @command{etags} recognizes the language used in an input file based 2389 @command{etags} recognizes the language used in an input file based on
2385on its file name and contents. You can specify the language 2390its file name and contents. It first tries to match the file's name and
2386explicitly with the @samp{--language=@var{name}} option. You can 2391extension to the ones commonly used with certain languages. Some
2387intermix these options with file names; each one applies to the file 2392languages have interpreters with known names (e.g., @command{perl} for
2388names that follow it. Specify @samp{--language=auto} to tell 2393Perl or @command{pl} for Prolog), so @command{etags} next looks for an
2389@command{etags} to resume guessing the language from the file names 2394interpreter specification of the form @samp{#!@var{interp}} on the first
2390and file contents. Specify @samp{--language=none} to turn off 2395line of an input file, and matches that against known interpreters. If
2391language-specific processing entirely; then @command{etags} recognizes 2396none of that works, or if you want to override the automatic detection of
2392tags by regexp matching alone (@pxref{Etags Regexps}). 2397the language, you can specify the language explicitly with the
2398@samp{--language=@var{name}} option. You can intermix these options with
2399file names; each one applies to the file names that follow it. Specify
2400@samp{--language=auto} to tell @command{etags} to resume guessing the
2401language from the file names and file contents. Specify
2402@samp{--language=none} to turn off language-specific processing entirely;
2403then @command{etags} recognizes tags by regexp matching alone
2404(@pxref{Etags Regexps}). This comes in handy when an input file uses a
2405language not yet supported by @command{etags}, and you want to avoid
2406having @command{etags} fall back on Fortran and C as the default
2407languages.
2393 2408
2394 The option @samp{--parse-stdin=@var{file}} is mostly useful when 2409 The option @samp{--parse-stdin=@var{file}} is mostly useful when
2395calling @command{etags} from programs. It can be used (only once) in 2410calling @command{etags} from programs. It can be used (only once) in