Next: Create Tags Table, Previous: Tags, Up: Tags [Contents][Index]
Here is how tag syntax is defined for the most popular languages:
struct
, union
and enum
. You can tag function
declarations and external variables in addition to function definitions
by giving the ‘--declarations’ option to etags
.
#define
macro definitions 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’. Use of ‘--no-globals’ and ‘--no-defines’
can make the tags table file much smaller.
operator
functions tags are
named, for example ‘operator+’.
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
, or \index
, is a
tag.
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="def:newcommand:newenvironment" export TEXTAGS
specifies (using Bourne shell syntax) that the commands ‘\def’, ‘\newcommand’ and ‘\newenvironment’ 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.
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:
With Ada, it is possible to have the same name used for different entity kinds (e.g. the same name for a procedure and 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 facilitate the choice to the user, a tag value is appended with a qualifier:
/f
/p
/s
/b
/t
/k
So, as an example, M-x find-tag bidule/b will go directly to the body of the package bidule while M-x find-tag bidule will just search for any tag bidule.
sub
,
my
and local
keywords. Use ‘--globals’ if you want
to tag global variables.
def
or class
at the beginning of a line
generate a tag.
You can also generate tags based on regexp matching (see Etags Regexps) to handle other formats and languages.
Next: Create Tags Table, Previous: Tags, Up: Tags [Contents][Index]