[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/detached a079753580 3/3: Describe session in a dedicate
From: |
ELPA Syncer |
Subject: |
[elpa] externals/detached a079753580 3/3: Describe session in a dedicated buffer |
Date: |
Fri, 14 Oct 2022 10:57:33 -0400 (EDT) |
branch: externals/detached
commit a0797535807f8d89f1c2c7d5269816e802257975
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Describe session in a dedicated buffer
Instead of using echo area.
---
detached.el | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/detached.el b/detached.el
index f3d2f4b00a..160fa3b09f 100644
--- a/detached.el
+++ b/detached.el
@@ -205,6 +205,14 @@ If set to a non nil value the latest entry to
:group 'detached
:type 'sexp)
+(defcustom detached-session-info-buffer-action
+ '(display-buffer-in-side-window
+ (side . bottom)
+ (dedicated . t))
+ "The action used to display a information about a detached session."
+ :group 'detached
+ :type 'sexp)
+
;;;;; Public
(defvar detached-enabled nil)
@@ -468,10 +476,15 @@ The session is compiled by opening its output and enabling
(defun detached-describe-session ()
"Describe current session."
(interactive)
- (when-let ((session (detached--get-session major-mode)))
- (message
- (string-trim
- (detached--session-header session)))))
+ (when-let* ((session (detached--get-session major-mode))
+ (buffer (get-buffer-create "*detached-session-info*"))
+ (window (display-buffer buffer
detached-session-info-buffer-action)))
+ (select-window window)
+ (with-current-buffer buffer
+ (erase-buffer)
+ (insert
+ (string-trim
+ (detached--session-header session))))))
;;;###autoload
(defun detached-attach-session (session)