Using Tags in Emacs
An Emacs feature called Tags provides an indexing mechanism
for Lisp, C, or Fortran source files. Before using Tags in
Emacs, you need to type this command at the system prompt:
etags filenames
...where filenames is a list of one or more names of the
files you wish to index. For example, if you are writing a C program
that has two source files, named file1.c and
file2.c, you would type:
etags file1.c file2.c
The etags command creates a file named TAGS,
which is used by the Emacs Tags functions.
Now you can use the Tags functions to locate tags (function
or routine names) in your source code.
Some of the useful Tags functions are:
- M-.
- Find first definition of a tag.
- M-x tags-search
- Search for a specified regular expression through the files in
the selected tag table.
- M-,
- Find next definition of previous tag, next occurrence of
specified regular expression.
For more information about Tags, read Section 21.10 of the
GNU Emacs Manual which is in the documentation racks in all
public Athena clusters, or on-line by using the Info Browser in Emacs.
(See the stock answer Using the INFO Browser for more
information.)