branch: externals/dtache commit 1cbeb7167e879ea67689041afdf9ad5c42149f2b Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Rename magic-command to dtache-command --- dtache.el | 8 ++++---- test/dtache-test.el | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dtache.el b/dtache.el index b881466aed..35f6d19fa9 100644 --- a/dtache.el +++ b/dtache.el @@ -676,11 +676,11 @@ Optionally CONCAT the command return command into a string." ,dtach-arg ,socket "-z" ,dtache-shell-program "-c" - ,(shell-quote-argument (dtache--magic-command session))) + ,(shell-quote-argument (dtache--dtache-command session))) " ") `(,dtach-arg ,socket "-z" ,dtache-shell-program "-c" - ,(dtache--magic-command session))))))) + ,(dtache--dtache-command session))))))) (defun dtache-attachable-command-p (command) "Return t if COMMAND is attachable." @@ -1050,8 +1050,8 @@ Optionally make the path LOCAL to host." (seq-do (lambda (pid) (dtache--kill-processes pid)) child-processes) (apply #'process-file `("kill" nil nil nil ,pid)))) -(defun dtache--magic-command (session) - "Return the magic dtache command for SESSION. +(defun dtache--dtache-command (session) + "Return the dtache command for SESSION. If SESSION is nonattachable fallback to a command that doesn't rely on tee." (let* ((log (dtache--session-file session 'log t)) diff --git a/test/dtache-test.el b/test/dtache-test.el index 1099fdd20a..e76ce98525 100644 --- a/test/dtache-test.el +++ b/test/dtache-test.el @@ -211,7 +211,7 @@ (dtache--db-update-entry copy t) (should (equal copy (car (dtache--db-get-sessions))))))) -(ert-deftest dtache-test-magic-command () +(ert-deftest dtache-test-dtache-command () (let ((attachable-session (dtache--session-create :directory "/tmp/dtache/" :working-directory "/home/user/" :command "ls -la" @@ -225,17 +225,17 @@ ;; With dtache-env (let ((dtache-env "dtache-env")) (should (string= "{ dtache-env ls\\ -la; } 2>&1 | tee /tmp/dtache/foo123.log" - (dtache--magic-command attachable-session))) + (dtache--dtache-command attachable-session))) (should (string= "{ dtache-env ls\\ -la; } &> /tmp/dtache/foo123.log" - (dtache--magic-command nonattachable-session)))) + (dtache--dtache-command nonattachable-session)))) ;; Without dtache-env (let ((dtache-env nil) (dtache-shell-program "bash")) (should (string= "{ bash -c ls\\ -la; } 2>&1 | tee /tmp/dtache/foo123.log" - (dtache--magic-command attachable-session))) + (dtache--dtache-command attachable-session))) (should (string= "{ bash -c ls\\ -la; } &> /tmp/dtache/foo123.log" - (dtache--magic-command nonattachable-session)))))) + (dtache--dtache-command nonattachable-session)))))) (ert-deftest dtache-test-attachable-command-p () (let ((dtache-nonattachable-commands '("ls")))