• etags With A Proper Database

    From Lawrence D'Oliveiro@21:1/5 to All on Sun Apr 14 01:37:59 2024
    XPost: nz.comp

    The etags program <https://www.gnu.org/software/emacs/manual/html_node/emacs/Tags-Tables.html> creates a text file listing the locations of symbol definitions, in a
    form that can be used to navigate your way around a complex project.

    As far as I know, though, no-one has thought of putting the symbol
    definitions into something like an SQLite database, for more
    convenient lookup.

    In my custom Emacs definitions <https://gitlab.com/ldo/emacs-prefs>, I
    wrote a Python program, called “project-tags”, which creates such a database, lets you keep it up to date, and of course perform lookups
    on it. I provide a command “find-def” for Emacs (in project-tags.el),
    which lets you invoke the lookup function of the project-tags program
    to obtain the definition of a selected symbol in the same project as
    the current source file, and go straight to there. If it finds more
    than one definition, then it puts up a list of the alternatives, for
    you to select from.

    A “project” is identified by default by the presence of a .git
    subdirectory in its top-level directory. Alternatively, you can define
    an arbitrary directory as the root of a project -- e.g. if you index
    all the symbols in /usr/include, then that makes it easy to find where
    system APIs are defined. The details of how to set this all up are
    explained in the enclosed man page for project-tags.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)