bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67687: Feature request: automatic tags management


From: Dmitry Gutov
Subject: bug#67687: Feature request: automatic tags management
Date: Sun, 10 Dec 2023 04:41:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi Jon!

On 07/12/2023 21:57, Jon Eskin wrote:

I have some related work that's been lying in a drawer as of late.

Do you know what gutentags does when a file is deleted, or added externally, or 
you switch to a different Git branch and many files change their contents at 
once?
To my knowledge, changes to tags due to files being added or deleted are 
regenerated only when vim is started inside the project. Switching to a 
different git branch should work the same, because it’s only looking at the 
filesystem.

If the editor is already running, such changes will not be picked up; even if 
you try to navigate to a tag that no longer exists, I do not believe that it 
will regenerate tags automatically until you close and re-open the editor.

When you save a file inside the editor, it will wipe out tags for that 
individual file and regenerate them.

All right, sounds like this kind of limited guarantees (tags getting out of date occasionally, e.g. when switching branches) is apparently okay.

See attached the aforementioned related work, with some updates and simplifications (e.g. this version of the patch doesn't require a change to project.el).

Usage: 'M-x etags-regen-mode' to turn it on (or customize this variable, to have it on from the beginning of each session), then as soon as you use features based on tags (such as M-. or completion) the table should get generated automatically for the current project, and then get updated when files are edited and saved.

Some features could be added later (such as asynchronous updates or -- someday -- filenotify based invalidations), but I think the current state is useful already.

Feedback welcome.

Attachment: etags-regen.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]