emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71290: closed (Options for viewing project buffers)


From: GNU bug Tracking System
Subject: bug#71290: closed (Options for viewing project buffers)
Date: Sun, 09 Jun 2024 02:52:01 +0000

Your message dated Sun, 9 Jun 2024 05:42:16 +0300
with message-id <ae45e32c-b975-41fc-9ed2-5b3900e52b95@gutov.dev>
and subject line Re: bug#71290: Options for viewing project buffers
has caused the debbugs.gnu.org bug report #71290,
regarding Options for viewing project buffers
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
71290: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71290
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Options for viewing project buffers Date: Fri, 31 May 2024 19:28:53 +0700 User-agent: Evolution 3.52.2
Greetings devs and emacs community.

I occasionally need to list buffers of a project and do so with the
built-in command project-list-buffers from project.el. The problem is
that this command utilizes Buffer-menu mode and does so in a hard-coded
way. Personally I prefer IBuffer which is already heavily customized
while I have zero knowledge of Buffer-menu mode. 

I suggest to make an option whether project.el will list buffers with
Ibuffer, Buffer-menu or even something else?

Kind regards,
-Mikhail



--- End Message ---
--- Begin Message --- Subject: Re: bug#71290: Options for viewing project buffers Date: Sun, 9 Jun 2024 05:42:16 +0300 User-agent: Mozilla Thunderbird
Hi!

On 05/06/2024 07:00, mikpom wrote:
So I implemented (thank  for a suggestion in Emacs-ru chat) optional
Ibuffer viewer. Diff on project.el is attached. It works in my setting.

This works, thank you. Pushed to master with expanded docstring and a minor fix (the ARG argument).

Also added the below patch.

This seems to work well, so marking this as resolved.

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index ab928a35e54..a16ff30395b 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1567,7 +1567,8 @@ project-list-buffers
     (funcall project-buffers-viewer pr arg)))

 (defun project-list-buffers-buffer-menu (project &optional files-only)
-  "Lists buffers of a project in Buffer-menu mode"
+  "List buffers for PROJECT in Buffer-menu mode.
+If FILES-ONLY is non-nil, only show the file-visiting buffers."
   (let ((buffer-list-function
          (lambda ()
            (seq-filter
@@ -1598,11 +1599,13 @@ project-list-buffers-buffer-menu
        (list-buffers-noselect files-only buffer-list-function)))))

 (defun project-list-buffers-ibuffer (project &optional files-only)
-  "Lists buffers of a project with Ibuffer"
-  ;; TODO files-only
+  "List buffers for PROJECT using Ibuffer.
+If FILES-ONLY is non-nil, only show the file-visiting buffers."
   (ibuffer t (format "*Ibuffer-%s*" (project-name project))
-           `((predicate . (member (current-buffer)
-                                  (project-buffers ',project))))))
+           `((predicate . (and
+                           (or ,(not files-only) buffer-file-name)
+                           (member (current-buffer)
+                                   (project-buffers ',project)))))))

 (defcustom project-kill-buffer-conditions
   '(buffer-file-name    ; All file-visiting buffers are included.



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]