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

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

[elpa] externals/detached 0d607044d9 03/38: Add session started predicat


From: ELPA Syncer
Subject: [elpa] externals/detached 0d607044d9 03/38: Add session started predicate
Date: Thu, 17 Nov 2022 17:57:53 -0500 (EST)

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

    Add session started predicate
---
 detached-compile.el | 2 +-
 detached.el         | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/detached-compile.el b/detached-compile.el
index 60d0b1ea82..9481b97782 100644
--- a/detached-compile.el
+++ b/detached-compile.el
@@ -113,7 +113,7 @@ Optionally EDIT-COMMAND."
          (pcase-let ((`(,_command ,mode ,name-function ,highlight-regexp) 
args))
                (if (eq detached-session-mode 'create)
                        (detached-start-detached-session 
detached--current-session)
-                 (apply compilation-start `(,(if (eq detached-session-mode 
'attach)
+                 (apply compilation-start `(,(if (detached-session-started-p 
detached--current-session)
                                           (detached--shell-command 
detached--current-session t)
                                         (detached-session-start-command 
detached--current-session
                                                                         :type 
'string))
diff --git a/detached.el b/detached.el
index f9d87df320..08ece25a5e 100644
--- a/detached.el
+++ b/detached.el
@@ -1073,6 +1073,10 @@ This function uses the `notifications' library."
   "Return command run in SESSION."
   (detached--session-command session))
 
+(defun detached-session-started-p (session)
+  "Return t if SESSION has been started."
+  (not (eq 'unknown (detached-session-state session))))
+
 (defun detached-session-validated-p (session)
   "Return t if SESSION has been validated."
   (not



reply via email to

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