|
From: | Dmitry Gutov |
Subject: | Re: Automatic (e)tags generation and incremental updates |
Date: | Wed, 13 Jan 2021 00:26:50 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 12.01.2021 19:55, Eli Zaretskii wrote:
Cc: tom@tromey.com, john@yates-sheets.org, philipk@posteo.net, emacs-devel@gnu.org From: Dmitry Gutov <dgutov@yandex.ru> Date: Tue, 12 Jan 2021 19:32:18 +0200What about regenerating etags only if M-. etc. fail to find an identifier?There are downsides. You will have to press M-. twice sometimes with that approach.Why twice? I thought about regenerating automatically once the search fails, then retrying the search with an updated tags table.
Hm, I guess we can do that.Still, I try to navigate to unknown symbols often enough. It can be an unfamiliar class, I don't know if it's defined here or in some dependency library... If every time I did that Emacs froze for, say, a second, and I didn't know the reasoning for it, my opinion of the editor would get pretty low.
So it might be a fine approach, but you have to know what it's doing and why. So, off by default.
Completion will routinely fail to show some tags that should be present. Also, if the rescan takes a while, I'm not sure you'd want to do that on every 'M-.' failure.You could also regenerate when the user switches to another branch. That's not a very frequent thing to do.
That can be part of it. So far the options seem to be:- Brute-force it with project-files and 'stat', checking to see which files were added, which removed, and which ones have modtime more recent than the previous update.
- Do something clever with Git. I.e. track the current revision, see whether it changed and which files changed with it, and also check the modtimes of untracked files.
- inotify. Seems to be the most effort-intensive option. I've also seen the 'watchman' program (by Facebook) mentioned as pretty reliable, but depending on it is probably not great.
Anyway, if you have any suggestions regarding how to write the file quicker (and why utf-8-emacs coding didn't help), that would be great.
[Prev in Thread] | Current Thread | [Next in Thread] |