Next: Creating Tags Tables, Up: Tags Tables [Contents][Index]
30.4.2.1 Source File Tag SyntaxHere is how tag syntax is defined for the most popular languages:
struct
, union
and enum
. #define
macro definitions, #undef
and enum
constants are also tags, unless you specify ‘--no-defines’ when making the tags table. Similarly, global variables are tags, unless you specify ‘--no-globals’, and so are struct members, unless you specify ‘--no-members’. Use of ‘--no-globals’, ‘--no-defines’ and ‘--no-members’ can make the tags table file much smaller.
You can tag function declarations and external variables in addition to function definitions by giving the ‘--declarations’ option to etags
.
operator
definitions have tag names like ‘operator+’. If you specify the ‘--class-qualify’ option, tags for variables and functions in classes are named ‘class::variable’ and ‘class::function’. By default, class methods and members are not class-qualified, which facilitates identifying their names in the sources more accurately.interface
, extends
and implements
constructs. Tags for variables and functions in classes are named ‘class.variable’ and ‘class.function’.\chapter
, \section
, \subsection
, \subsubsection
, \eqno
, \label
, \ref
, \cite
, \bibitem
, \part
, \appendix
, \entry
, \index
, \def
, \newcommand
, \renewcommand
, \newenvironment
and \renewenvironment
are tags.
Other commands can make tags as well, if you specify them in the environment variable TEXTAGS
before invoking etags
. The value of this environment variable should be a colon-separated list of command names. For example,
TEXTAGS="mycommand:myothercommand" export TEXTAGS
specifies (using Bourne shell syntax) that the commands ‘\mycommand’ and ‘\myothercommand’ also define tags.
defun
, any variable defined with defvar
or defconst
, and in general the first argument of any expression that starts with ‘(def’ in column zero is a tag. As an exception, expressions of the form (defvar foo)
are treated as declarations, and are only tagged if the ‘--declarations’ option is given.def
or with a construct whose name starts with ‘def’. They also include variables set with set!
at top level in the file.Several other languages are also supported:
In Ada, the same name can be used for different kinds of entity (e.g., for a procedure and for a function). Also, for things like packages, procedures and functions, there is the spec (i.e., the interface) and the body (i.e., the implementation). To make it easier to pick the definition you want, Ada tag names have suffixes indicating the type of entity:
package body.
function.
task.
procedure.
package spec.
type.
Thus, M-x find-tag RET bidule/b RET will go directly to the body of the package bidule
, while M-x find-tag RET bidule RET will just search for any tag bidule
.
title
and the h1
, h2
, h3
headers. Also, tags are name=
in anchors and all occurrences of id=
.package
, sub
, use constant
, my
, and local
keywords. Use ‘--globals’ if you want to tag global variables. Tags for subroutines are named ‘package::sub’. The name for subroutines defined in the default package is ‘main::sub’.def
or class
at the beginning of a line generate a tag.def
or class
or module
at the beginning of a line generate a tag. Constants also generate tags.fn
, enum
, struct
or macro_rules!
.You can also generate tags based on regexp matching (see Etags Regexps) to handle other formats and languages.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4