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

From: Juri Linkov <[email-masked]>
Date: Sat, 10 Dec 2022 19:45:09 +0200

> 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.

>> 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))