# find-tag(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

find-tag - Find tag, auto-load file and move to tag position

## SYNOPSIS

n find-tag "string" (esc t)

## DESCRIPTION

find-tag finds the current or given tag (string) in a tags file and goes to the given point, loading the file if necessary. The tag is either the current word under the cursor or a user supplied word if the cursor is not in a word. The buffer containing the tag is popped up in another window and the cursor moved to the tag in the new window.

A tags file is usually created by an external program (e.g. ctags(1)) which stores word references (or tags) and the name of the file containing the tag, with a search string to go to its local. It is an indexing system which is often used in programming.

The argument n can be used to change the default behavior of find-tag described above, n is a bit based flag where:-

0x01

Use popup-window to display the tag in a different window (default) when this flag is not given the current window is used to display the tag.

0x02

Disable the use of the current cursor position to determine the tag. Instead the tag must always be supplied through "string".

0x04

Find the next definition of the last tag (multiple tag support). This feature can only be used if multiple tag support is enabled (see flag 'm' of variable %tag-option(5)) and find-tag has already been successfully executed. In this situation the last invocation of find-tag defines the current tag and executing again with an argument of `4` will jump to the next definition of the current tag or return the message "`[No more "<current>" tags]`".

The next tag is typically bound to `M-C-t`.

The tags file is, by default, assumed to reside in the current directory of the currently viewed file. The user variable %tag-option(5) may be specified with a value of '`r`' (recursive) and '`c`' (continue) flags, which ascends the directory tree from the current directory and attempts to locate a recursively generated tags file at a higher directory level. Recursive tag files are generally easier to maintain where project source files are located in a number of project sub-directories, and enable the whole of the project tree to be taggable.

Two user variables must be defined before find-tag will execute, if either %tag-file(5) or %tag-template(5) are not defined the error message "[tags not setup]" is signaled.

## NOTES

A tags file may be generated by MicroEmacs 2009 from the menu (Tools->XX Tools->Create Tags File). Alternatively a tags file may be generated by the ctags(1) utility. This is typically standard on UNIX platforms. For Windows and DOS platforms then the Exuberant Ctags is recommended, this is available from:-

`http://darren.hiebert.com`

A MicroEmacs 2009 compatible tags file may be generated using the command line "`ctags -N --format=1 ."` cataloging the current directory. To generate tags for a directory tree then use "`ctags -NR -format=1 .`". Refer to the Exuberant Ctags documentation for a more detailed description of the utility.

## SEE ALSO

%tag-file(5), %tag-option(5), %tag-template(5), generate-tags-file(3), ctags(1).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>