branch: externals/detached commit 141bb36075ccd414dc548c1c9b321ea1c1b635a1 Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Improve support for local sessions --- detached-compile.el | 10 ++++++---- detached.el | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/detached-compile.el b/detached-compile.el index d2507487a4..fefc3648eb 100644 --- a/detached-compile.el +++ b/detached-compile.el @@ -89,14 +89,13 @@ Optionally EDIT-COMMAND." (when (detached-valid-session session) (detached-with-session session (let* ((detached-enabled t)) - (compilation-start detached-session-command))))) + (compilation-start `(,detached-session-command)))))) ;;;###autoload (defun detached-compile-start-session (session) "Start SESSION with `detached-compile'." (detached-with-session session - (let* ((detached-enabled t)) - (detached-compile detached-session-command)))) + (detached-compile detached-session-command))) ;;;;; Support functions @@ -125,7 +124,10 @@ Optionally EDIT-COMMAND." highlight-regexp)))) (detached-current-session (or detached-current-session - (detached-create-session command)))) + (detached-create-session command))) + (default-directory (if (detached--session-local-p detached-current-session) + (detached-session-directory detached-current-session) + (detached-session-working-directory detached-current-session)))) (if (eq detached-session-mode 'detached) (detached-start-session detached-current-session) (apply compilation-start `(,(if (detached-session-started-p detached-current-session) diff --git a/detached.el b/detached.el index ca12272d7e..3abf2d61eb 100644 --- a/detached.el +++ b/detached.el @@ -926,6 +926,9 @@ This function uses the `notifications' library." (defun detached-start-shell-command-session (session) "Start SESSION as a `shell-command'." (cl-letf* ((inhibit-message t) + (default-directory (if (detached--session-local-p session) + (detached-session-directory session) + (detached-session-working-directory session))) ((symbol-function #'set-process-sentinel) #'ignore) (buffer (detached--generate-buffer detached--shell-command-buffer (lambda (buffer)