From 5100ab121d7b3d6bee6bf06773443fe3581be308 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 24 Nov 2023 10:33:57 -0500 Subject: [PATCH] fix(upload): ssh-deploy-on-explicit-save: incorrect type According to upstream package emacs-ssh-deploy, the value 0 should disable the auto-save behavior. As the ssh-deploy-on-explicit-save is considered true if its value is 0, it triggers the after-save-hook anyway. This commit fixes the hook so it conforms to upstream definition: ssh-deploy-on-explicit-save Enabled automatic uploads on save (integer) Co-authored-by: visika Close: #7513 Fix: #7512 --- modules/tools/upload/README.org | 2 +- modules/tools/upload/config.el | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/tools/upload/README.org b/modules/tools/upload/README.org index 0cdff03e6..4b2445a61 100644 --- a/modules/tools/upload/README.org +++ b/modules/tools/upload/README.org @@ -47,7 +47,7 @@ to establish this mapping. E.g. #+begin_src emacs-lisp ((nil . ((ssh-deploy-root-local . "/local/path/to/project") (ssh-deploy-root-remote . "/ssh:user@server:/remote/project/") - (ssh-deploy-on-explicit-save . t)))) + (ssh-deploy-on-explicit-save . 1)))) #+end_src #+begin_quote diff --git a/modules/tools/upload/config.el b/modules/tools/upload/config.el index dadc824c7..25e2829be 100644 --- a/modules/tools/upload/config.el +++ b/modules/tools/upload/config.el @@ -37,7 +37,8 @@ (add-hook! 'after-save-hook (defun +upload-init-after-save-h () (when (and (bound-and-true-p ssh-deploy-root-remote) - ssh-deploy-on-explicit-save) + (integerp ssh-deploy-on-explicit-save) + (> ssh-deploy-on-explicit-save 0)) (ssh-deploy-upload-handler ssh-deploy-force-on-explicit-save)))) ;; Enable ssh-deploy if variables are set, and check for changes on open file