GNU bug report logs -
#59935
29.0.60; project-list-buffers is slow
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Sat, 10 Dec 2022 01:50:02 UTC
Severity: normal
Fixed in version 29.0.60
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 59935 <at> debbugs.gnu.org (full text, mbox):
On 10/12/2022 03:49, Dmitry Gutov wrote:
> 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.
The combined fix for both can be this:
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 016dfdd5b4..835ab07e50 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1340,18 +1340,21 @@ project-list-buffers
start with a space (which are for internal use). With prefix argument
ARG, show only buffers that are visiting files."
(interactive "P")
- (let ((pr (project-current t)))
+ (let* ((pr (project-current t))
+ (fetcher (lambda ()
+ (cl-delete-if-not
+ (lambda (b)
+ (or (buffer-file-name b)
+ (string-match-p "\\`[^ ]" (buffer-name b))))
+ (project-buffers pr)))))
(display-buffer
- (if (version< emacs-version "29.0.50")
- (let ((buf (list-buffers-noselect arg (project-buffers pr))))
- (with-current-buffer buf
- (setq-local revert-buffer-function
- (lambda (&rest _ignored)
- (list-buffers--refresh (project-buffers pr))
- (tabulated-list-print t))))
- buf)
- (list-buffers-noselect
- arg nil (lambda (buf) (memq buf (project-buffers pr))))))))
+ (let ((buf (list-buffers-noselect arg (funcall fetcher))))
+ (with-current-buffer buf
+ (setq-local revert-buffer-function
+ (lambda (&rest _ignored)
+ (list-buffers--refresh (funcall fetcher))
+ (tabulated-list-print t))))
+ buf))))
(defcustom project-kill-buffer-conditions
'(buffer-file-name ; All file-visiting buffers are included.
This bug report was last modified 2 years and 215 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.