]> git.eshelyaron.com Git - emacs.git/commitdiff
project-list-buffers-ibuffer: Handle the FILES-ONLY argument
authorDmitry Gutov <dmitry@gutov.dev>
Sun, 9 Jun 2024 02:37:25 +0000 (05:37 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Jun 2024 09:52:38 +0000 (11:52 +0200)
* lisp/progmodes/project.el (project-list-buffers-ibuffer):
Handle the FILES-ONLY argument (bug71290).
(project-list-buffers-buffer-menu): Expand docstring.

(cherry picked from commit a486782f5ee394a432eebd1dc507ff558a8d7198)

lisp/progmodes/project.el

index 7efa5e2a38054abbffa5bcaf2e9a593a67754819..d73fac81280dc8686b516432956b19111451c0fd 100644 (file)
@@ -1569,7 +1569,8 @@ ARG, show only buffers that are visiting files."
     (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
@@ -1600,11 +1601,13 @@ ARG, show only buffers that are visiting files."
        (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.