Emacs jumping to tags

In lesson 4 around 1:18 mark Jeremy talks about easily finding function/class definitions from within Vim using tags:

I use Emacs and the first few times going though this course I skipped this part, but 3rd time through I thought I should figure it out - so for anyone else wondering:

git clone https://github.com/fastai/fastai.git
cd fastai/fastai
find . -type f -name '*.py' | xargs etags

This will build a TAGS table/file in the current directory. If you’re on Linux and have Emacs installed, you should also have a program called etags installed.

Now from Emacs you should be able to hit M-. and search for any definition with tab completion and it should jump to it.

If all you work on is Fastai and you want this TAGS table to be set every time you start Emacs, add this to your .emacs:
(setq tags-file-name "/home/nojeffrey/fastai/fastai/TAGS")

Else it will prompt you which TAGS table to use after searching for a definition for the first time.

1 Like