branch: externals/dtache commit 848f3a943a3e2b63fe065d7da6d4f161d8371806 Author: Niklas Eklund <niklas.ekl...@zenseact.com> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Update attach naming --- dtache-eshell.el | 2 +- dtache-shell.el | 2 +- dtache.el | 38 +++++++++++++++++++------------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dtache-eshell.el b/dtache-eshell.el index 86ecca7bc1..f3f1d36387 100644 --- a/dtache-eshell.el +++ b/dtache-eshell.el @@ -33,7 +33,7 @@ ;;;; Variables (defcustom dtache-eshell-session-action - '(:attach dtache-shell-command-attach + '(:attach dtache-attach :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 a353a72b41..301fc4d2c0 100644 --- a/dtache-shell.el +++ b/dtache-shell.el @@ -30,7 +30,7 @@ ;;;; Variables (defcustom dtache-shell-session-action - '(:attach dtache-shell-command-attach + '(:attach dtache-attach :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 2d3c739c59..7f02d32d1a 100644 --- a/dtache.el +++ b/dtache.el @@ -109,7 +109,7 @@ :group 'dtache) (defcustom dtache-shell-command-action - '(:attach dtache-shell-command-attach + '(:attach dtache-attach :view dtache-view-dwim :run dtache-shell-command) "Actions for a session created with `dtache-shell-command'." @@ -269,8 +269,8 @@ Optionally SUPPRESS-OUTPUT." (list (dtache-completing-read (dtache-get-sessions)))) (when (dtache-valid-session session) (if (dtache--session-active-p session) - (dtache-attach-session session) - (dtache-view-session session)))) + (dtache--attach-session session) + (dtache--view-session session)))) ;;;###autoload (defun dtache-post-compile-session (session) @@ -623,33 +623,19 @@ If session is not valid trigger an automatic cleanup on SESSION's host." (dtache--update-sessions) (dtache--db-get-sessions)) -(defun dtache-shell-command-attach (session) +(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 (dtache--session-redirect-only session) - (dtache-attach-session session) + (dtache--attach-session session) (cl-letf* (((symbol-function #'set-process-sentinel) #'ignore) (buffer "*Dtache Shell Command*")) (funcall #'async-shell-command (dtache--session-command session) buffer) (with-current-buffer buffer (setq dtache--buffer-session dtache--current-session))))))) -(defun dtache-attach-session (session) - "Attach to SESSION." - (if (dtache--session-redirect-only session) - (dtache-tail-output session) - (if-let ((attach-fun (plist-get (dtache--session-action session) :attach))) - (funcall attach-fun session) - (dtache-tail-output session)))) - -(defun dtache-view-session (session) - "View SESSION." - (if-let ((view-fun (plist-get (dtache--session-action session) :view))) - (funcall view-fun session) - (dtache-view-dwim session))) - ;;;;; Other (cl-defgeneric dtache-dtach-command (entity &optional concat) @@ -931,6 +917,20 @@ Optionally make the path LOCAL to host." short-home (expand-file-name default-directory)))) +(defun dtache--attach-session (session) + "Attach to SESSION." + (if (dtache--session-redirect-only session) + (dtache-tail-output session) + (if-let ((attach-fun (plist-get (dtache--session-action session) :attach))) + (funcall attach-fun session) + (dtache-tail-output session)))) + +(defun dtache--view-session (session) + "View SESSION." + (if-let ((view-fun (plist-get (dtache--session-action session) :view))) + (funcall view-fun session) + (dtache-view-dwim session))) + ;;;;; Database (defun dtache--db-initialize ()