branch: externals/detached commit 0d607044d9c7ae2e8bfb34763df14654342cf579 Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@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