Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


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.)

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.