Search documentation of tools

# View Source tags (tools v4.0)

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

## Types

option()

## Functions

dir(Dir)

Equivalent to `dir(Dir, [])`.

dir(Dir, Options)

Create a `TAGS` file for all files in directory `Dir`.

dirs(DirList)

Equivalent to `dirs(Dirs, [])`.

dirs(DirList, Options)

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

file(File)

Equivalent to `file(Name, [])`.

file(File, Options)

Create a `TAGS` file for the file `File`.

files(FileList)

Equivalent to `files(Files, [])`.

files(FileList, Options)

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

root()

Equivalent to `root([])`.

root(Options)

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

subdir(Dir)

Equivalent to `subdir(Dir, [])`.

subdir(Dir, Options)

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

subdirs(DirList)

Equivalent to `subdirs(Dirs, [])`.

subdirs(DirList, Options)

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

# Types

Link to this type

# option()

View Source (not exported)

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

# Functions

Link to this function

# dir(Dir)

View Source

    -spec dir(Dir) -> ok | error when Dir :: file:filename().

Equivalent to `dir(Dir, [])`.

Link to this function

# dir(Dir, Options)

View Source

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

Create a `TAGS` file for all files in directory `Dir`.

Link to this function

# dirs(DirList)

View Source

    -spec dirs(DirList) -> ok | error when DirList :: [file:filename()].

Equivalent to `dirs(Dirs, [])`.

Link to this function

# dirs(DirList, Options)

View Source

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

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

Link to this function

# file(File)

View Source

    -spec file(File) -> ok | error when File :: file:filename().

Equivalent to `file(Name, [])`.

Link to this function

# file(File, Options)

View Source

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

Create a `TAGS` file for the file `File`.

Link to this function

# files(FileList)

View Source

    -spec files(FileList) -> ok | error when FileList :: [file:filename()].

Equivalent to `files(Files, [])`.

Link to this function

# files(FileList, Options)

View Source

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

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

Link to this function

# root()

View Source

    -spec root() -> ok | error.

Equivalent to `root([])`.

Link to this function

# root(Options)

View Source

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

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

Link to this function

# subdir(Dir)

View Source

    -spec subdir(Dir) -> ok | error when Dir :: file:filename().

Equivalent to `subdir(Dir, [])`.

Link to this function

# subdir(Dir, Options)

View Source

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

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

Link to this function

# subdirs(DirList)

View Source

    -spec subdirs(DirList) -> ok | error when DirList :: [file:filename()].

Equivalent to `subdirs(Dirs, [])`.

Link to this function

# subdirs(DirList, Options)

View Source

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

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