martes, 18 de mayo de 2021

etags: an useful tool to generate tags in Emacs

etags is an useful tool to generate tag tables for Emacs (ctags is the same but for vi). This allows us to jump to a function defined in some file in the code, without having to remember in which file is it. As could be expected, this tool understand the syntax of a lot of programming languages, like C, C++, Fortran, HTML or LaTeX.

 

To use it, in the folder where the code is run

     etags *.f90

 

This generates a file called TAGS with the information (a tag table) about in which .f90 is each function and subroutine of the code.


Then, in Emacs move the cursor on the subroutine/function what you want, and ATL+. (ALT and dot) opens the .f90 file where the subroutine/function is with the cursor on the definition of it. To go back, hit ALT+, (ALT and comma).


For more tips related with emacs visit papitas emacs.