|
From: | Dmitry Gutov |
Subject: | Re: xref and leaving "temporary" buffers open |
Date: | Mon, 3 Aug 2015 05:12:32 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 |
On 07/31/2015 12:41 AM, Stefan Monnier wrote:
So, you'd limit the changes to the higher level, like read-buffer-to-switch and internal-complete-buffer-except?Yes.
We'll need to also catch the moment, somehow, when an "incomplete" buffer become displayed as a result of user's action. And "complete" its initialization at that point.
Would you use window-configuration-change-hook for that?
AFAIK they (should) all skip the "hidden buffers" (those starting with a space), so we'd just have to make those incomplete buffers use a name with a leading space.
Indeed. Thinking about it initially, I was under impression that most of those tools have a view that shows all buffers including ephemeral (which could then be overwhelmed by the full list of "incomplete" buffers), but apparently not. The exceptions can adapt later.
By the way, I'm considering naming them "delayed buffers" (like in delay-mode-hooks), and the respective function would be find-file-delayed.
And depending on the file size, the overhead from vc-find-file-hook may become noticeable, too. In (find-file-noselect ".gitignore"), it takes more than half of the time (15 out of 25 ms), here.But for xdisp.c, that's probably negligible compared to the syntax-propertize call ;-)
Well, at least the slowdown will be proportional to the file size, and less impacted by the quantity only (that will improve the case of many small files).
And we don't always need to propertize until the end of the file (the match could be in the beginning). Opening xdisp.c, even without calling syntax-propertize, takes a lot of time now, but that should be optimizable.
Anyway, simply being allowed to open any files and not worry about cleaning up their buffers will simplify things for xref considerably.
[Prev in Thread] | Current Thread | [Next in Thread] |