branch: externals/dtache commit 5831137cf75fe7291e6f33677bc5e54db4d8adb2 Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Rename dtache-initialize to dtache-setup All extensions have dtache-.*-setup functions that should be used. But the core package had dtache-initialize. This patch renames the core function in order to harmonize the naming. It also makes sure the other setup functions runs dtache-setup, which in case of that has already been called will do nothing. --- README.org | 2 +- dtache-compile.el | 1 + dtache-eshell.el | 1 + dtache-shell.el | 1 + dtache.el | 3 ++- test/dtache-test.el | 2 +- 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index f0d6b93a12..5e1111904b 100644 --- a/README.org +++ b/README.org @@ -57,7 +57,7 @@ A minimal configuration for =dtache=. #+begin_src elisp :lexical t :results none (use-package dtache - :hook (after-init . dtache-initialize) + :hook (after-init . dtache-setup) :bind (([remap async-shell-command] . dtache-shell-command) :map dtache-shell-mode-map ("C-c C-q" . dtache-detach-dwim))) diff --git a/dtache-compile.el b/dtache-compile.el index 824b977f38..7a5a869069 100644 --- a/dtache-compile.el +++ b/dtache-compile.el @@ -106,6 +106,7 @@ Optionally EDIT-COMMAND." ;;;###autoload (defun dtache-compile-setup () "Setup `dtache-compile'." + (dtache-setup) (advice-add #'compilation-start :around #'dtache-compile-advice) (add-hook 'compilation-start-hook #'dtache-compile-maybe-start)) diff --git a/dtache-eshell.el b/dtache-eshell.el index fb0387775c..9d39e7a7ba 100644 --- a/dtache-eshell.el +++ b/dtache-eshell.el @@ -39,6 +39,7 @@ ;;;###autoload (defun dtache-eshell-setup () "Setup `dtache-eshell'." + (dtache-setup) (add-hook 'eshell-prepare-command-hook #'dtache-eshell-maybe-create-session) (add-hook 'eshell-mode-hook #'dtache-eshell-mode)) diff --git a/dtache-shell.el b/dtache-shell.el index 7329b0b03d..6be40c0ba8 100644 --- a/dtache-shell.el +++ b/dtache-shell.el @@ -51,6 +51,7 @@ This function also makes sure that the HISTFILE is disabled for local shells." ;;;###autoload (defun dtache-shell-setup () "Setup `dtache-shell'." + (dtache-setup) (add-hook 'shell-mode-hook #'dtache-shell-save-history) (advice-add 'shell :around #'dtache-shell-override-history)) diff --git a/dtache.el b/dtache.el index b90e6bfe75..a25d28155f 100644 --- a/dtache.el +++ b/dtache.el @@ -81,6 +81,7 @@ "A property list defining how often to run a timer.") (defvar dtache-shell-command-action '(:attach dtache-shell-command-attach :view dtache-view-dwim :run dtache-shell-command) "Actions for a session created with `dtache-shell-command'.") + (defvar dtache-annotation-format `((:width 3 :function dtache--active-str :face dtache-active-face) (:width 3 :function dtache--status-str :face dtache-failure-face) @@ -539,7 +540,7 @@ Optionally make the path LOCAL to host." (dtache--db-update-entry session))) ;;;###autoload -(defun dtache-initialize () +(defun dtache-setup () "Initialize `dtache'." ;; Initialize sessions diff --git a/test/dtache-test.el b/test/dtache-test.el index d28318cdcf..85a7a08d0a 100644 --- a/test/dtache-test.el +++ b/test/dtache-test.el @@ -38,7 +38,7 @@ (dtache--remote-session-timer)) (unwind-protect (progn - (dtache-initialize) + (dtache-setup) ,@body) (delete-directory temp-directory t))))