|
From: | Dmitry Gutov |
Subject: | bug#59935: 29.0.60; project-list-buffers is slow |
Date: | Sun, 11 Dec 2022 20:37:51 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
On 11/12/2022 19:07, Juri Linkov wrote:
+(defvar-local Buffer-menu-buffer-list-function nil + "Function to return buffers for the buffer list.") (setq Buffer-menu-files-only (and files-only (>= (prefix-numeric-value files-only) 0))) - (setq Buffer-menu-filter-predicate filter-predicate) + (when (functionp buffer-list) + (setq Buffer-menu-buffer-list-function buffer-list))
Here's an idea: when 'list-buffers-noselect' received a plain list of buffers in its BUFFER-LIST argument, it doesn't save that anywhere.
That seems like a bug, doesn't it? That hitting 'g' in such a buffer-list buffer resets its contents to all buffer (except hidden, etc).
So it probably makes sense to save it as well.Long story short, I suggest to name the new variable Buffer-menu-buffer-list, and save the value of the BUFFER-LIST argument to it no matter what. And, likewise, use it. But when the value is a function, call it to obtain the actual list.
One side-effect of this, though, is that the BUFFER-LIST argument to list-buffers--refresh will have no purpose anymore.
[Prev in Thread] | Current Thread | [Next in Thread] |