|
From: | Dmitry Gutov |
Subject: | Re: Automatic (e)tags generation and incremental updates |
Date: | Thu, 7 Jan 2021 17:56:57 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hi Eli, On 07.01.2021 16:15, Eli Zaretskii wrote:
Thanks for working on this branch. However, it is hard to check it out without investing an inordinate amount of time, without having some guidance: what features are added, how they work, and what are the relevant commands to invoke them and variables to control them. Would it be possible to post a short summary of that? The changes are large, and when I looked at them, it was hard for me to figure out what exactly are we gaining and how to test that.
The changes are now fairly small and non-invasive, you can review the diff like this: git diff master...scratch/etags-regen
They include:- New file and new minor mode etags-regen-mode with 3 defcustom's (see the docstrings).
- A change to .dir-locals.el which sets the value of one of those options, so that the resulting tags table for the Emacs project itself looks close enough to what 'make tags' generates.
- A change to lib-src/etags.c which implements handing of '-L' flag, for compatibility with ctags.
To try it out: - Start Emacs built from this branch and open, say, src/xdisp.c. - Call 'M-x etags-regen-mode' to enable it. - DO NOT call 'M-x visit-tags-table'.- Call some xref command like 'M-.'. See message "Generating new tags table..." (it's saved in /tmp/...), then see navigation happen.
- Pressing C-M-i instead should also trigger tags table generation.- Rename some function, try navigating to the new name. That should work. Navigation to the previous name should fail (unless there are other definitions for that name).
What doesn't work:- When you switch between projects, the previously generated tags tables are discarded. It's not too hard to improve, but that would involve some choices/tradeoffs.
- When files are deleted, or otherwise changed outside of Emacs (perhaps with 'git checkout'), nothing is updated. I have a few new ideas, haven't started on them yet. Workaround: toggle etags-regen-mode off and on, which will result in full rescan when you use 'M-.'.
[Prev in Thread] | Current Thread | [Next in Thread] |