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

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

[elpa] externals/dtache 28cb384d96 143/158: Update attach with fallback


From: ELPA Syncer
Subject: [elpa] externals/dtache 28cb384d96 143/158: Update attach with fallback
Date: Wed, 19 Jan 2022 18:58:08 -0500 (EST)

branch: externals/dtache
commit 28cb384d9612d2c74bb42ea52b9bb919c3c01f73
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Update attach with fallback
---
 dtache.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/dtache.el b/dtache.el
index 3f19da9a38..eef31a7c90 100644
--- a/dtache.el
+++ b/dtache.el
@@ -327,16 +327,19 @@ Optionally SUPPRESS-OUTPUT."
   (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)))))))
+    (if (or (eq 'inactive (dtache--session-state session))
+            (not (dtache--session-attachable session)))
+        (dtache-open-output 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)



reply via email to

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