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

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

On 10/12/2022 19:45, Juri Linkov wrote:
>> Not sure what's the best fix here (especially in time for the release),
>> but if the FILTER-PREDICATE arg to list-buffers-noselect turned into a
>> factory function (e.g. FILTER-PREDICATE-MAKER), that would be one
>> solution.
> 
> I see only one solution: to replace the argument FILTER-PREDICATE
> with BUFFER-LIST-FUNCTION.

Ah yeah, that should also work.

>>> Curiously, though, it shows a different list of buffers. It also
>>> includes "hidden" buffers - diff-syntax, Echo Area, etc. We should look
>>> into that either way.
>> +                    (cl-delete-if-not
>> +                     (lambda (b)
>> +                       (or (buffer-file-name b)
>> +                           (string-match-p "\\`[^ ]" (buffer-name b))))
>> +                     (project-buffers pr)))))
> 
> Please try to copy the exact logic from list-buffers--refresh:
> 
> 			 (and (or (not (string= (substring name 0 1) " "))
>                                    buffer-file-name)
> 			      (not (eq buffer (current-buffer)))
> 			      (or file (not Buffer-menu-files-only))

Do you have the time to finish the fix yourself? It was your feature, 
after all.