emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/detached 7b50bb16c8 3/9: Add display buffer action for


From: ELPA Syncer
Subject: [elpa] externals/detached 7b50bb16c8 3/9: Add display buffer action for detached list
Date: Thu, 22 Sep 2022 09:57:34 -0400 (EDT)

branch: externals/detached
commit 7b50bb16c864345859386ba164a83921a687aee0
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Add display buffer action for detached list
---
 detached-list.el | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/detached-list.el b/detached-list.el
index a49c476c03..f7474b4ae4 100644
--- a/detached-list.el
+++ b/detached-list.el
@@ -43,6 +43,12 @@
   :type '(repeat symbol)
   :group 'detached)
 
+(defcustom detached-list-display-buffer-action '(display-buffer-same-window
+                                                 (inhibit-same-window . nil))
+  "The action used to display the detached list buffer."
+  :group 'detached
+  :type 'list)
+
 ;;;; Private
 
 (defvar-local detached-list--marked-sessions nil
@@ -301,14 +307,6 @@ If prefix-argument is provided unmark instead of mark."
 (defun detached-list-sessions ()
   "Open list of `detached'."
   (interactive)
-  (let ((buffer (get-buffer-create "*detached-list*")))
-    (pop-to-buffer-same-window buffer)
-    (detached-list-mode)
-    (setq tabulated-list-entries
-          (seq-map #'detached-list--get-entry
-                   (detached-list--get-filtered-sessions)))
-    (tabulated-list-print t)))
-
 (defun detached-list-narrow-sessions (filter)
   "Narrow session(s) based on FILTER."
   (let* ((current-filters `(,filter ,@detached-list--filters))
@@ -326,6 +324,15 @@ If prefix-argument is provided unmark instead of mark."
           (seq-map #'detached-list--get-entry
                    (detached-list--get-filtered-sessions)))
     (tabulated-list-print t)))
+  (let* ((buffer (detached-list--get-buffer))
+         (window (display-buffer buffer detached-list-display-buffer-action)))
+    (with-selected-window window
+      (detached-list-mode)
+      (setq tabulated-list-entries
+            (seq-map #'detached-list--get-entry
+                     (detached-list--get-filtered-sessions)))
+      (tabulated-list-print t))))
+
 
 ;;;; Support functions
 



reply via email to

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