[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/detached 4cc2c4e40f 12/38: Add select host session comp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/detached 4cc2c4e40f 12/38: Add select host session completion function |
Date: |
Thu, 17 Nov 2022 17:57:54 -0500 (EST) |
branch: externals/detached
commit 4cc2c4e40fbe236f378be8773c4d55e678fbbab2
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add select host session completion function
---
detached-eshell.el | 12 +-----------
detached-shell.el | 12 +-----------
detached.el | 10 ++++++++++
3 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/detached-eshell.el b/detached-eshell.el
index 29248dcc5e..0712b0f3bf 100644
--- a/detached-eshell.el
+++ b/detached-eshell.el
@@ -74,7 +74,7 @@ If prefix-argument directly DETACH from the session."
(defun detached-eshell-attach-session (session)
"Attach to SESSION."
(interactive
- (list (detached-eshell--select-session)))
+ (list (detached-select-host-session)))
(when (detached-valid-session session)
(if (detached-session-active-p session)
(cl-letf* ((detached-session-mode 'attach)
@@ -104,16 +104,6 @@ If prefix-argument directly DETACH from the session."
(and (string= (process-name process) "dtach")
process)))
-(defun detached-eshell--select-session ()
- "Return selected session."
- (let* ((host-name (car (detached--host)))
- (sessions
- (thread-last (detached-get-sessions)
- (seq-filter (lambda (it)
- (string= (detached-session-host-name it)
host-name)))
- (seq-filter #'detached-session-active-p))))
- (detached-completing-read sessions)))
-
(cl-defmethod detached--detach-session ((_mode (derived-mode eshell-mode)))
"Detach from session when MODE is `eshell-mode'."
(when-let ((active-session (detached-session-active-p
detached-buffer-session))
diff --git a/detached-shell.el b/detached-shell.el
index 8e0f44773e..c6ba5de14f 100644
--- a/detached-shell.el
+++ b/detached-shell.el
@@ -73,7 +73,7 @@ This function also makes sure that the HISTFILE is disabled
for local shells."
`comint-add-to-input-history' is temporarily disabled to avoid
cluttering the `comint-history' with dtach commands."
(interactive
- (list (detached-shell--select-session)))
+ (list (detached-select-host-session)))
(when (detached-valid-session session)
(if (detached-session-active-p session)
(cl-letf ((detached-current-session session)
@@ -88,16 +88,6 @@ cluttering the `comint-history' with dtach commands."
;;;; Support functions
-(defun detached-shell--select-session ()
- "Return selected session."
- (let* ((host-name (car (detached--host)))
- (sessions
- (thread-last (detached-get-sessions)
- (seq-filter (lambda (it)
- (string= (detached-session-host-name it)
host-name)))
- (seq-filter #'detached-session-active-p))))
- (detached-completing-read sessions)))
-
(defun detached-shell--attach-input-sender (proc _string)
"Attach to `detached--session' and send the attach command to PROC."
(let* ((detached-session-mode 'attach)
diff --git a/detached.el b/detached.el
index cec91828ea..d659c5d1f9 100644
--- a/detached.el
+++ b/detached.el
@@ -1278,6 +1278,16 @@ Optionally CONCAT the command return command into a
string."
(push `(,(car annotator) . ,(funcall (cdr annotator))) metadata))
metadata))
+(defun detached-select-host-session ()
+ "Return selected session."
+ (let* ((host-name (car (detached--host)))
+ (sessions
+ (thread-last (detached-get-sessions)
+ (seq-filter (lambda (it)
+ (string= (detached-session-host-name it)
host-name)))
+ (seq-filter #'detached-session-active-p))))
+ (detached-completing-read sessions)))
+
(defun detached-completing-read (sessions)
"Select a session from SESSIONS through `completing-read'."
(let* ((candidates (detached-session-candidates sessions))
- [elpa] externals/detached 3c7ac1730f 34/38: Add session environment property getter, (continued)
- [elpa] externals/detached 3c7ac1730f 34/38: Add session environment property getter, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 236f6c95af 08/38: Improve implementation, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 0ca53e29ff 09/38: Remove error check, ELPA Syncer, 2022/11/17
- [elpa] externals/detached fec1a4c7bd 24/38: Update function signatures, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 473fcc2d43 23/38: Rename detached-session-modes, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 5c212b2609 05/38: Update start-detached-session, ELPA Syncer, 2022/11/17
- [elpa] externals/detached aca448c773 19/38: Revert marks in list when widening, ELPA Syncer, 2022/11/17
- [elpa] externals/detached f70ac98dc5 21/38: Remove dtach--arg dependency, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 18c388bb48 36/38: Update attach shell command, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 88f925ee15 14/38: Add missing string-join, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 4cc2c4e40f 12/38: Add select host session completion function,
ELPA Syncer <=
- [elpa] externals/detached d1c3861e8e 16/38: Add public function for session directory, ELPA Syncer, 2022/11/17
- [elpa] externals/detached ca0ee7e465 37/38: Add detach key to session map, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 274993d9c9 20/38: Remove 'started state, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 51858bceb7 26/38: Begin rework of how to start a session, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 65c661bc9c 27/38: Change detached env to text-mode, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 3dc3651e98 18/38: Add session working directory function, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 88618a9cee 17/38: Add public function for session command, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 4b3609385d 01/38: Start session rewrite, ELPA Syncer, 2022/11/17
- [elpa] externals/detached f0f9728e2c 31/38: Make local predicate private, ELPA Syncer, 2022/11/17
- [elpa] externals/detached 09b37f681c 30/38: Add detached-with-session macro, ELPA Syncer, 2022/11/17