aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--perspective.el16
2 files changed, 15 insertions, 6 deletions
diff --git a/README.md b/README.md
index 85ac362..95b04e6 100644
--- a/README.md
+++ b/README.md
@@ -166,6 +166,11 @@ to use a Perspective-aware buffer switcher.
in particular its `ido-switch-buffer` command, is automatically
Perspective-aware when `persp-mode` is enabled.
+**buffer-menu**: Perspective provides a wrapper for
+[`buffer-menu`](https://www.gnu.org/software/emacs/manual/html_node/emacs/List-Buffers.html):
+`persp-buffer-menu`. When this function is called normally, it shows the buffer menu filtered by the current perspective. With a prefix argument, it shows the
+buffer menu of all the buffers in all perspectives.
+
**`bs.el`**: Perspective provides a wrapper for
[`bs-show`](https://www.gnu.org/software/emacs/manual/html_node/emacs/Buffer-Menus.html):
`persp-bs-show`. When this function is called normally, it shows a list of
diff --git a/perspective.el b/perspective.el
index 8147a09..e1100ce 100644
--- a/perspective.el
+++ b/perspective.el
@@ -826,12 +826,6 @@ Prefers perspectives in the selected frame."
(persp-switch (cdr other-persp)))
(switch-to-buffer buffer)))))
-(defun persp-list-buffers ()
- "Like the default C-x C-b, but filters for the current perspective's buffers."
- (interactive)
- (switch-to-buffer
- (list-buffers-noselect nil (seq-filter 'buffer-live-p (persp-current-buffers)))))
-
(defun persp-remove-buffer (buffer)
"Disassociate BUFFER with the current perspective.
@@ -1267,6 +1261,16 @@ PERSP-SET-IDO-BUFFERS)."
(buffer-name (current-buffer))))))
(kill-buffer buffer-or-name))
+;; Buffer switching integration: buffer-menu
+;;;###autoload
+(defun persp-buffer-menu (arg)
+ "Like the default C-x C-b, but filters for the current perspective's buffers."
+ (interactive "P")
+ (if (and persp-mode (null arg))
+ (switch-to-buffer
+ (list-buffers-noselect nil (seq-filter 'buffer-live-p (persp-current-buffers))))
+ (display-buffer (list-buffers-noselect))))
+
;; Buffer switching integration: bs.el.
;;;###autoload
(defun persp-bs-show (arg)