I am working through the "Emacs Lisp Intro" book within Emacs 23.4.1 on Debian Wheezy (CrunchBang Waldorf).

Section 4.1 discusses the find-tags command and the TAGS file. Instructions are included to build/install the TAGS file if necessary.

How do I do this in Debian? The folders mentioned are not present on my system and I cannot locate a TAGS file.

I'm not sure that I have the source of Emacs installed? I installed it using apt-get. My sources.list file does not include any deb-src lines, if that is relevant.

  • 1
    Try apt-get install ctags.
    – Kevin
    Dec 9, 2012 at 0:35

3 Answers 3

daniel@protein:~$ apt-file search {ctags,etags} | grep ctags | grep /usr/bin
emacs23-bin-common: /usr/bin/ctags.emacs23
exuberant-ctags: /usr/bin/ctags-exuberant

I'm on ubuntu, but I'm reasonably sure they're in the same packages.

To create the TAGS file you'll want something like this:

$ find . -type f -iname "*.php" | xargs ctags --declarations
$ find . -type f -iname "*.ctp" | xargs ctags --lang="php" --declarations --append

Both commands have very similar arguments, but check the man page to make sure.

  • Thanks, but I think the problem lay elsewhere, as detailed in my answer.
    – SabreWolfy
    Dec 9, 2012 at 6:04
  • No worries, and nice work on the real solution. Upvoted.
    – Daniel
    Dec 9, 2012 at 12:23

This required installing the emacs23-el package for the Emacs source code and then building the TAGS file in /usr/share/emacs/23.4/lisp with:

$ etags *.el.gz

as these files are in .gz format. However, find-tags cannot read these and attempts to read the .el file. This can be solved, as explained here, by adding the following to ~/.emacs:

(require 'jka-compr)

After this, it is possible to enter find-tags and then mark-whole-buffer, as discussed in the example in the "Emacs Lisp Intro" mentioned in the question.


I'm using Emacs 24.5.1 (via dnf [formerly yum {much like apt-get}]) on Fedora 22 and what worked for me was navigating to /usr/share/emacs/24.5/lisp and running:

etags *.el.gz

Nothing further was required for me to follow along with the tutorial.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .