GNU bug report logs -
#59153
List project buffers
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Wed, 9 Nov 2022 17:44:01 UTC
Severity: wishlist
Tags: patch
Fixed in version 29.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 59153 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:
> What is still missing is a command to list project buffers:
>
> C-x C-b (list-buffers) - C-x p C-b (project-list-buffers)
>
> project-kill-buffers already shows a list of project buffers,
> but only as a part of confirmation for killing buffers.
>
> Here is a patch that adds the missing command. Its argument
> has exactly the same meaning as in 'list-buffers'.
>
> +;;;###autoload
> +(defun project-list-buffers (&optional arg)
> + "Display a list of project buffers.
> +The list is displayed in a buffer named \"*Buffer List*\".
> +
> +By default, all buffers are listed except those whose names 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))
> + (bufs (mapcan
> + (lambda (buf)
> + (when (and (project--buffer-check buf '("\\`[^ ]"))
> + (or (not arg)
> + (project--buffer-check buf '(buffer-file-name))))
> + (list buf)))
> + (project-buffers pr))))
> + (display-buffer (list-buffers-noselect arg bufs))))
This won't survive a revert buffer, I think. (I'll show all buffers
then.)
--
Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5
Fediverse: akib <at> hostux.social
Codeberg: akib
emailselfdefense.fsf.org | "Nothing can be secure without encryption."
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 2 years and 243 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.