branch: externals/dtache commit 59f2ac4ab5238c3bb24bf32ce0cea38ee1658a81 Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Rename dtache--dtach-mode to dtache-session-mode --- README.org | 4 ++-- dtache-compile.el | 8 ++++---- dtache-eshell.el | 6 +++--- dtache-shell.el | 8 ++++---- dtache.el | 22 +++++++++++----------- test/dtache-test.el | 4 ++-- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.org b/README.org index 8d9597cd8f..e3c20eacdf 100644 --- a/README.org +++ b/README.org @@ -321,7 +321,7 @@ A part from the extensions provided with this package the users of =dtache= can "Run `dired-rsync' with `dtache'." (interactive) (let* ((dtache-enabled t) - (dtache--dtach-mode 'new)) + (dtache-session-mode 'new)) (call-interactively #'dired-rsync))) #+end_src @@ -331,7 +331,7 @@ Or enhancing the built in =dired-do-async-shell-command=. (defun my/dtache-dired-do-async-shell-command () (interactive) (let* ((dtache-enabled t) - (dtache--dtach-mode 'create)) + (dtache-session-mode 'create)) (call-interactively #'dired-do-async-shell-command))) #+end_src diff --git a/dtache-compile.el b/dtache-compile.el index 72458662d9..d6c2c76ed2 100644 --- a/dtache-compile.el +++ b/dtache-compile.el @@ -48,7 +48,7 @@ Optionally enable COMINT if prefix-argument is provided." (let* ((dtache-enabled t) (dtache-session-action dtache-compile-session-action) (dtache-session-type 'compile) - (dtache--dtach-mode 'create)) + (dtache-session-mode 'create)) (compile command comint))) ;;;###autoload @@ -59,7 +59,7 @@ Optionally EDIT-COMMAND." (let* ((dtache-enabled t) (dtache-session-action dtache-compile-session-action) (dtache-session-type 'compile) - (dtache--dtach-mode 'create)) + (dtache-session-mode 'create)) (recompile edit-command))) ;;;;; Functions @@ -69,7 +69,7 @@ Optionally EDIT-COMMAND." (if dtache-enabled (pcase-let ((`(,command ,mode ,_ ,highlight-regexp) args) (buffer-name "*dtache-compilation*")) - (if (and (not (eq dtache--dtach-mode 'attach)) + (if (and (not (eq dtache-session-mode 'attach)) (dtache-redirect-only-p command)) (dtache-start-session command t) (cl-letf* ((name-function (lambda (_) buffer-name)) @@ -93,7 +93,7 @@ Optionally EDIT-COMMAND." "Attach to SESSION with `compile'." (when (dtache-valid-session session) (let* ((dtache-enabled t) - (dtache--dtach-mode 'attach) + (dtache-session-mode 'attach) (dtache--current-session session)) (compilation-start (dtache--session-command session))))) diff --git a/dtache-eshell.el b/dtache-eshell.el index 5674a78810..395d638a9a 100644 --- a/dtache-eshell.el +++ b/dtache-eshell.el @@ -56,7 +56,7 @@ (defun dtache-eshell-maybe-create-session () "Create a session if `dtache-eshell-command' value is t." (when dtache-eshell-command - (let* ((dtache--dtach-mode 'create) + (let* ((dtache-session-mode 'create) (dtache-session-action dtache-shell-session-action) (command (mapconcat #'identity `(,eshell-last-command-name @@ -82,7 +82,7 @@ If prefix-argument directly DETACH from the session." (interactive "P") (let* ((dtache-session-type 'eshell) - (dtache--dtach-mode (if detach 'new 'create)) + (dtache-session-mode (if detach 'new 'create)) (dtache-eshell-command t)) (call-interactively #'eshell-send-input))) @@ -94,7 +94,7 @@ If prefix-argument directly DETACH from the session." (when (dtache-valid-session session) (if (and (dtache--session-active-p session) (not (dtache--session-redirect-only session))) - (cl-letf* ((dtache--dtach-mode 'attach) + (cl-letf* ((dtache-session-mode 'attach) (input (dtache-dtach-command session t)) ((symbol-function #'eshell-add-to-history) #'ignore)) diff --git a/dtache-shell.el b/dtache-shell.el index c54575a9af..2db49ef8f6 100644 --- a/dtache-shell.el +++ b/dtache-shell.el @@ -80,7 +80,7 @@ This function also makes sure that the HISTFILE is disabled for local shells." (interactive "P") (let* ((dtache-session-type 'shell) (dtache-session-action dtache-shell-session-action) - (dtache--dtach-mode (if detach 'new 'create)) + (dtache-session-mode (if detach 'new 'create)) (comint-input-sender #'dtache-shell--create-input-sender)) (comint-send-input))) @@ -107,7 +107,7 @@ cluttering the comint-history with dtach commands." (defun dtache-shell--attach-input-sender (proc _string) "Attach to `dtache--session' and send the attach command to PROC." - (let* ((dtache--dtach-mode 'attach) + (let* ((dtache-session-mode 'attach) (input (dtache-dtach-command dtache-shell--current-session t))) (comint-simple-send proc input))) @@ -120,13 +120,13 @@ cluttering the comint-history with dtach commands." (lambda (blocked) (string-match-p blocked string)) dtache-shell-block-list))) - (dtache--dtach-mode + (dtache-session-mode (if (seq-find (lambda (blocked) (string-match-p blocked string)) dtache-shell-new-block-list) 'create - dtache--dtach-mode)) + dtache-session-mode)) (dtach-command (dtache-dtach-command (substring-no-properties string) t))) (comint-simple-send proc dtach-command) (comint-simple-send proc string)))) diff --git a/dtache.el b/dtache.el index f57fa6c93e..1e03d3c249 100644 --- a/dtache.el +++ b/dtache.el @@ -159,7 +159,7 @@ (defvar dtache--sessions-initialized nil "Sessions are initialized.") -(defvar dtache--dtach-mode nil +(defvar dtache-session-mode nil "Mode of operation for dtach.") (defvar dtache--sessions nil "A list of sessions.") @@ -447,15 +447,15 @@ Optionally SUPPRESS-OUTPUT." (or dtache--current-session (dtache-create-session command)))) (if-let ((run-in-background - (and (not (eq dtache--dtach-mode 'attach)) + (and (not (eq dtache-session-mode 'attach)) (or suppress-output - (eq dtache--dtach-mode 'new) + (eq dtache-session-mode 'new) (dtache-redirect-only-p command)))) - (dtache--dtach-mode 'new)) + (dtache-session-mode 'new)) (apply #'start-file-process-shell-command `("dtache" nil ,command)) (cl-letf* (((symbol-function #'set-process-sentinel) #'ignore) - (dtache--dtach-mode (or dtache--dtach-mode 'create)) + (dtache-session-mode (or dtache-session-mode 'create)) (buffer "*Dtache Shell Command*")) (funcall #'async-shell-command command buffer) (with-current-buffer buffer (setq dtache--buffer-session dtache--current-session)))))) @@ -631,7 +631,7 @@ If session is not valid trigger an automatic cleanup on SESSION's host." "Attach to `dtache' SESSION." (when (dtache-valid-session session) (let* ((dtache--current-session session) - (dtache--dtach-mode 'attach)) + (dtache-session-mode 'attach)) (dtache-start-session (dtache--session-command session))))) (defun dtache-delete-sessions () @@ -684,12 +684,12 @@ Optionally CONCAT the command return command into a string." Optionally CONCAT the command return command into a string." (with-connection-local-variables - (let* ((dtache--dtach-mode (cond ((eq dtache--dtach-mode 'attach) 'attach) + (let* ((dtache-session-mode (cond ((eq dtache-session-mode 'attach) 'attach) ((dtache--session-redirect-only session) 'new) - (t dtache--dtach-mode))) + (t dtache-session-mode))) (socket (dtache-session-file session 'socket t))) (setq dtache--buffer-session session) - (if (eq dtache--dtach-mode 'attach) + (if (eq dtache-session-mode 'attach) (if concat (mapconcat 'identity `(,dtache-dtach-program @@ -933,8 +933,8 @@ Optionally CONCAT the command return command into a string." ;;;;; Other (defun dtache--dtach-arg () - "Return dtach argument based on mode." - (pcase dtache--dtach-mode + "Return dtach argument based on `dtache-session-mode'." + (pcase dtache-session-mode ('new "-n") ('create "-c") ('attach "-a") diff --git a/test/dtache-test.el b/test/dtache-test.el index a56ce06f46..d28318cdcf 100644 --- a/test/dtache-test.el +++ b/test/dtache-test.el @@ -73,7 +73,7 @@ ((symbol-function #'dtache-create-session) (lambda (_) session))) - (let* ((dtache--dtach-mode 'create) + (let* ((dtache-session-mode 'create) (expected `("-c" ,(dtache-session-file session 'socket t) "-z" ,dtache-shell-program "-c" @@ -88,7 +88,7 @@ (dtache-session-file session 'log t)))))) (should (equal expected (dtache-dtach-command session))) (should (equal expected-concat (dtache-dtach-command session t)))) - (let* ((dtache--dtach-mode 'attach) + (let* ((dtache-session-mode 'attach) (expected `("-a" ,(dtache-session-file session 'socket t))) (expected-concat (format "%s -a %s" dtach-program