[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 5d78cfb3b3 142/158: Add attach command
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 5d78cfb3b3 142/158: Add attach command |
Date: |
Wed, 19 Jan 2022 18:58:08 -0500 (EST) |
branch: externals/dtache
commit 5d78cfb3b39f67741ddacf1bd146952ecd8c31e0
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add attach command
---
README.org | 1 +
dtache-eshell.el | 2 +-
dtache-shell.el | 2 +-
dtache.el | 32 ++++++++++++++++++--------------
4 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/README.org b/README.org
index d27e0791fe..1b2d678986 100644
--- a/README.org
+++ b/README.org
@@ -92,6 +92,7 @@ The actions are controlled by the customizable variables
named =dtache-.*-sessio
| Command (Keybinding) | Description
|
|-----------------------------------+---------------------------------------------|
| dtache-open-output (o) | Open a session's output
|
+| dtache-attach (a) | Attach to a session
|
| dtache-tail-output (t) | Tail the output of an active session
|
| dtache-diff-session (=) | Diff a session with another session
|
| dtache-post-compile-session (c) | Open the session output in compilation
mode |
diff --git a/dtache-eshell.el b/dtache-eshell.el
index 5083c31f88..1a0086abf4 100644
--- a/dtache-eshell.el
+++ b/dtache-eshell.el
@@ -33,7 +33,7 @@
;;;; Variables
(defcustom dtache-eshell-session-action
- '(:attach dtache-attach
+ '(:attach dtache-tail-output
:view dtache-view-dwim
:run dtache-shell-command)
"Actions for a session created with `dtache-eshell'."
diff --git a/dtache-shell.el b/dtache-shell.el
index 483ae3360f..1506776735 100644
--- a/dtache-shell.el
+++ b/dtache-shell.el
@@ -30,7 +30,7 @@
;;;; Variables
(defcustom dtache-shell-session-action
- '(:attach dtache-attach
+ '(:attach dtache-tail-output
:view dtache-view-dwim
:run dtache-shell-command)
"Actions for a session created with `dtache-shell'."
diff --git a/dtache.el b/dtache.el
index 0c58937fcf..3f19da9a38 100644
--- a/dtache.el
+++ b/dtache.el
@@ -149,6 +149,7 @@ This version is encoded as [package-version].[revision].")
(defvar dtache-action-map
(let ((map (make-sparse-keymap)))
+ (define-key map "a" #'dtache-attach)
(define-key map "c" #'dtache-post-compile-session)
(define-key map "d" #'dtache-delete-session)
(define-key map "i" #'dtache-insert-session-command)
@@ -320,6 +321,23 @@ Optionally SUPPRESS-OUTPUT."
(funcall run-fun command)
(dtache-start-session command))))))
+;;;###autoload
+(defun dtache-attach (session)
+ "Attach to SESSION."
+ (interactive
+ (list (dtache-completing-read (dtache-get-sessions))))
+ (when (dtache-valid-session session)
+ (let* ((dtache--current-session session)
+ (dtache-session-mode 'attach)
+ (inhibit-message t))
+ (if (not (dtache--session-attachable session))
+ (dtache-tail-output session)
+ (cl-letf* (((symbol-function #'set-process-sentinel) #'ignore)
+ (buffer dtache--shell-command-buffer)
+ (dtach-command (dtache-dtach-command session t)))
+ (funcall #'async-shell-command dtach-command buffer)
+ (with-current-buffer buffer (setq dtache--buffer-session
dtache--current-session)))))))
+
;;;###autoload
(defun dtache-copy-session-output (session)
"Copy SESSION's log."
@@ -629,20 +647,6 @@ If session is not valid trigger an automatic cleanup on
SESSION's host."
(dtache--update-sessions)
(dtache--db-get-sessions))
-(defun dtache-attach (session)
- "Attach to `dtache' SESSION."
- (when (dtache-valid-session session)
- (let* ((dtache--current-session session)
- (dtache-session-mode 'attach)
- (inhibit-message t))
- (if (not (dtache--session-attachable session))
- (dtache-tail-output session)
- (cl-letf* (((symbol-function #'set-process-sentinel) #'ignore)
- (buffer dtache--shell-command-buffer)
- (dtach-command (dtache-dtach-command session t)))
- (funcall #'async-shell-command dtach-command buffer)
- (with-current-buffer buffer (setq dtache--buffer-session
dtache--current-session)))))))
-
;;;;; Other
(cl-defgeneric dtache-dtach-command (entity &optional concat)
- [elpa] externals/dtache e0a45c055c 133/158: Address error in eshell/shell extension, (continued)
- [elpa] externals/dtache e0a45c055c 133/158: Address error in eshell/shell extension, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 34c7d23346 088/158: Make dtache-eshell compatible with recent changes, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 2354197acb 096/158: Fix error in dtache-compile, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 5da693be75 100/158: Update CHANGELOG, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 0c8241a33d 107/158: Update actions from defvar to defcustom, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 848f3a943a 108/158: Update attach naming, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 52c82428ac 110/158: Remove documentation directory, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 9f948349a3 112/158: Rename dtache-detach to dtache-detach-dwim, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 4c47fa3ddb 122/158: Fix error in dtache-attach, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 71d7e3ad35 119/158: Update how duration is determined, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 5d78cfb3b3 142/158: Add attach command,
ELPA Syncer <=
- [elpa] externals/dtache 94f207eeeb 149/158: Make dtache utilize notifications library, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 668f6aca83 157/158: Improve dtache-kill-session, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache e3af56003d 063/158: Remove unnecessary header declarations, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache dd9c2a0095 066/158: Add contributions section in README, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 59f2ac4ab5 084/158: Rename dtache--dtach-mode to dtache-session-mode, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 1cbeb7167e 136/158: Rename magic-command to dtache-command, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 954b642659 074/158: Demote attach commands to functions, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 4778eda4df 085/158: Rename compile-session to post-compile-session, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 06cb91da1d 097/158: Make dtache-session-directory have a default value, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 4284951870 103/158: Make dtache-delete-sessions a command, ELPA Syncer, 2022/01/19