Subject: bug#59935: 29.0.60; project-list-buffers is slow

From: Dmitry Gutov <[email-masked]>
Date: Sat, 10 Dec 2022 21:53:28 +0200

On 10/12/2022 21:42, Eli Zaretskii wrote:
>> Date: Sat, 10 Dec 2022 21:19:30 +0200
>> Cc:[email-masked],[email-masked]
>> From: Dmitry Gutov<[email-masked]>
>>
>> On 10/12/2022 16:33, Eli Zaretskii wrote:
>>> OK, but I didn't suggest making any changes to revert-buffer-function
>>> set up by "C-x p C-b".  You can still use process-buffers there, and
>>> it shouldn't slow down "C-x p C-b" itself, since the call to
>>> process-buffers that is part of revert-buffer-function is not supposed
>>> to be evaluated when you set revert-buffer-function.  Right?  Or what
>>> else am I missing?
>> Then only the 'g' binding will remain slow. An improvement, of course.
> Why slow? it calls project-buffers only once.

You're looking at the "legacy" code path. Where emacs-version is < 29.

In the "new" one revert-buffer-function uses the filter-predicate 
argument we pass to list-buffers-noselect. Which is

   (lambda (buf) (memq buf (project-buffers pr)))