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.