Skip to content

Latest commit

 

History

History
126 lines (95 loc) · 5.08 KB

cross-reference-with-ctags.rst.txt

File metadata and controls

126 lines (95 loc) · 5.08 KB

Using ctags and etags for cross referencing with TAGS

Home URL:https://github.com/pierre-rouleau/pel
Project:PEL -- Pragmatic Emacs Library
Created:Wednesday, June 5 2024.
Author: Pierre Rouleau <[email protected]>
Modified:2025-03-01 21:25:09 EST, updated by Pierre Rouleau.
Copyright: © 2024, 2025, Pierre Rouleau

The Ctags programs

Reference: Ctags @ Wikipedia

The first version of the ctags program appeared in the early 90's. Other implementation appeared over time as shown here:

  • BSD Unix 3.0 Ctags (1992)
  • Emacs etags and ctags
    • etags generates a Emacs-style TAGS file.
    • ctags generates a vi-style TAGS file.

Emacs has its own program, etags which generates a format that Emacs understand. Emacs also provides a version of ctags that generates the vi-style format used elsewhere.

Also see the 🚦 Xref-Support PDF.

The PEL project provides a set of file finding and TAGS creation tools that use etags. Some of them will also use the Universal Ctags program when the ETAGS_USE_UCTAGS environment variable is set to 1 or the absolute path of Universal Ctags executable file to force using Universal Ctags. When setting it to 1, the ctags found in PATH is expected to be Universal Ctags.

PEL etags tools

This includes the following utilities that Build a Emacs-compliant TAGS for specific programming language sets for the source code files in specified directory tree(s).

Utility Programming Language
etags-c C and C++
etags-el Emacs Lisp and C
etags-erl Erlang and C
etags-go Go
etags-lisp Common Lisp
etags-py Python
etags-rs Rust

There's also a set of etags builder for build tool files:

Utility Build Tool Language
etags-autotools GNU Autotools files (which includes GNU Makefiles).
etags-make GNU Makefiles only.

Each of these utilities support a command line with the [-h|--help] options and print more information.

You can install symbolic links to the files inside the PEL bin directory by executing the pel/bin/setup/install-etags-builders.sh script from any POSIX compliant shell.