tags (tools v4.1.4)

Copy Markdown View Source

Generate Emacs TAGS file from Erlang source files

A TAGS file is used by Emacs to find function and variable definitions in any source file in large projects. This module can generate a TAGS file from Erlang source files. It recognises functions, records, and macro definitions.

Options

The functions in this module have an optional argument Options. It is a list which can contain the following elements:

  • {outfile, NameOfTAGSFile} Create a TAGS file named NameOfTAGSFile.
  • {outdir, NameOfDirectory} Create a file named TAGS in the directory NameOfDirectory.

The default behaviour is to create a file named TAGS in the current directory.

Examples

  • tags:root([{outfile, "root.TAGS"}]).

    This command will create a file named root.TAGS in the current directory. The file will contain references to all Erlang source files in the Erlang distribution.

  • tags:files(["foo.erl", "bar.erl", "baz.erl"], [{outdir, "../projectdir"}]).

    This command will create a file named TAGS placed it in the directory ../projectdir. The file contains information about the functions, records, and macro definitions of the three files.

See Also

  • Richard M. Stallman. GNU Emacs Manual, chapter "Editing Programs", section "Tag Tables". Free Software Foundation, 1995.
  • Anders Lindgren. The Erlang editing mode for Emacs. Ericsson, 1998.

Summary

Functions

Create a TAGS file for all files in directory Dir.

Create a TAGS file for all files in any directory in DirList.

Create a TAGS file for the file File.

Create a TAGS file for the files in the list FileList.

Create a TAGS file covering all files in the Erlang distribution.

Descend recursively into the directory Dir and create a TAGS file based on all files found.

Descend recursively into the directories in DirList and create a TAGS file based on all files found.

Types

option()

(not exported)
-type option() ::
          {outfile, NameOfTAGSFile :: file:filename()} | {outdir, NameOfDirectory :: file:filename()}.

Functions

dir(Dir) ≡ dir(Dir, [])

dir(Dir :: file:filename(), Options :: [option()]) -> ok | error

Create a TAGS file for all files in directory Dir.

dirs(DirList) ≡ dirs(Dirs, [])

dirs(DirList :: [file:filename()], Options :: [option()]) -> ok | error

Create a TAGS file for all files in any directory in DirList.

file(File) ≡ file(Name, [])

file(File :: file:filename(), Options :: [option()]) -> ok | error

Create a TAGS file for the file File.

files(FileList) ≡ files(Files, [])

files(FileList :: [file:filename()], Options :: [option()]) -> ok | error

Create a TAGS file for the files in the list FileList.

root() ≡ root([])

root(Options :: [option()]) -> ok | error

Create a TAGS file covering all files in the Erlang distribution.

subdir(Dir) ≡ subdir(Dir, [])

subdir(Dir :: file:filename(), Options :: [option()]) -> ok | error

Descend recursively into the directory Dir and create a TAGS file based on all files found.

subdirs(DirList) ≡ subdirs(Dirs, [])

subdirs(DirList :: [file:filename()], Options :: [option()]) -> ok | error

Descend recursively into the directories in DirList and create a TAGS file based on all files found.