diff options
| author | Constantine Vetoshev <gepardcv@gmail.com> | 2021-03-09 16:25:40 -0800 |
|---|---|---|
| committer | Constantine Vetoshev <gepardcv@gmail.com> | 2021-03-09 16:25:40 -0800 |
| commit | d647cd8c8101ac784c01f0fb4ce5c62ebcfb3eed (patch) | |
| tree | 91f67deecf9a1a59d9acd613a45b6385916dcbd8 | |
| parent | 1070f406209e6251657788115b7f05a5b5cdeaf9 (diff) | |
Make persp-buffer-menu and persp-list-buffers consistent with built-in buffer-menu and list-buffers.
| -rw-r--r-- | README.md | 15 | ||||
| -rw-r--r-- | perspective.el | 12 |
2 files changed, 22 insertions, 5 deletions
@@ -166,10 +166,17 @@ 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. +**list-buffers / buffer-menu**: Perspective provides wrappers for the similar +[`list-buffers` and +`buffer-menu`](https://www.gnu.org/software/emacs/manual/html_node/emacs/List-Buffers.html): +`persp-list-buffers` and `persp-buffer-menu`. (Note that Emacs binds `C-x C-b` +to `list-buffers` by default.) When these functions are called normally, they +show the buffer menu filtered by the current perspective. With a prefix +argument, they show the buffer menu of all the buffers in all perspectives. (The +difference between `list-buffers` and `buffer-menu`: the former calls +`display-buffer`, i.e., may split windows depending on `display-buffer-alist`, +and the latter calls `switch-to-buffer`, i.e., flips the current window to the +buffer list buffer.) **`bs.el`**: Perspective provides a wrapper for [`bs-show`](https://www.gnu.org/software/emacs/manual/html_node/emacs/Buffer-Menus.html): diff --git a/perspective.el b/perspective.el index e1100ce..bcac3ed 100644 --- a/perspective.el +++ b/perspective.el @@ -1261,7 +1261,7 @@ PERSP-SET-IDO-BUFFERS)." (buffer-name (current-buffer)))))) (kill-buffer buffer-or-name)) -;; Buffer switching integration: buffer-menu +;; 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." @@ -1269,6 +1269,16 @@ PERSP-SET-IDO-BUFFERS)." (if (and persp-mode (null arg)) (switch-to-buffer (list-buffers-noselect nil (seq-filter 'buffer-live-p (persp-current-buffers)))) + (switch-to-buffer (list-buffers-noselect)))) + +;; Buffer switching integration: list-buffers. +;;;###autoload +(defun persp-list-buffers (arg) + "Like the default C-x C-b, but filters for the current perspective's buffers." + (interactive "P") + (if (and persp-mode (null arg)) + (display-buffer + (list-buffers-noselect nil (seq-filter 'buffer-live-p (persp-current-buffers)))) (display-buffer (list-buffers-noselect)))) ;; Buffer switching integration: bs.el. |
