emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ssh-deploy a1a9d3c 051/133: Work on lisp code styling w


From: Stefan Monnier
Subject: [elpa] externals/ssh-deploy a1a9d3c 051/133: Work on lisp code styling with (if), (progn) and (when)
Date: Sat, 27 Mar 2021 14:48:42 -0400 (EDT)

branch: externals/ssh-deploy
commit a1a9d3cad1102f9f95fe6c2515681370dfa2567d
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Work on lisp code styling with (if), (progn) and (when)
---
 ssh-deploy-diff-mode.el |  94 ++++-----
 ssh-deploy.el           | 508 +++++++++++++++++++++++-------------------------
 2 files changed, 294 insertions(+), 308 deletions(-)

diff --git a/ssh-deploy-diff-mode.el b/ssh-deploy-diff-mode.el
index 9c46594..6b6f6eb 100644
--- a/ssh-deploy-diff-mode.el
+++ b/ssh-deploy-diff-mode.el
@@ -77,61 +77,61 @@
   (save-excursion
     (beginning-of-line)
     (let ((file nil))
-      (if (looking-at "^- ")
-          (let* ((start (+ 2 (line-beginning-position)))
-                 (end (line-end-position)))
-            (setq file (buffer-substring-no-properties start end))))
+      (when (looking-at "^- ")
+        (let* ((start (+ 2 (line-beginning-position)))
+               (end (line-end-position)))
+          (setq file (buffer-substring-no-properties start end))))
       (while (and (> (line-number-at-pos) 1)
                   (not (looking-at "^[A-Z]+")))
         (forward-line -1))
-      (if (looking-at "^[A-Z]")
-          (let* ((start (line-beginning-position))
-                 (end (line-end-position))
-                 (section (buffer-substring-no-properties start end)))
-            (setq section (replace-regexp-in-string ": ([0-9]+)\\'" "" 
section))
-            (setq section
-                  (pcase section
-                    ("DIRECTORY A" 'directory-a)
-                    ("DIRECTORY B" 'directory-b)
-                    ("EXCLUDE-LIST" 'exclude-list)
-                    ("FILES ONLY IN A" 'only-in-a)
-                    ("FILES ONLY IN B" 'only-in-b)
-                    ("FILES IN BOTH BUT DIFFERS" 'in-both)
-                    (_ (message "Could not find section %s" section)
-                       section)))
-            (while (and (> (line-number-at-pos) 1)
-                        (not (looking-at "^DIRECTORY B:")))
-              (forward-line -1))
-            (if (looking-at "^DIRECTORY B:")
+      (when (looking-at "^[A-Z]")
+        (let* ((start (line-beginning-position))
+               (end (line-end-position))
+               (section (buffer-substring-no-properties start end)))
+          (setq section (replace-regexp-in-string ": ([0-9]+)\\'" "" section))
+          (setq section
+                (pcase section
+                  ("DIRECTORY A" 'directory-a)
+                  ("DIRECTORY B" 'directory-b)
+                  ("EXCLUDE-LIST" 'exclude-list)
+                  ("FILES ONLY IN A" 'only-in-a)
+                  ("FILES ONLY IN B" 'only-in-b)
+                  ("FILES IN BOTH BUT DIFFERS" 'in-both)
+                  (_ (message "Could not find section %s" section)
+                     section)))
+          (while (and (> (line-number-at-pos) 1)
+                      (not (looking-at "^DIRECTORY B:")))
+            (forward-line -1))
+          (when (looking-at "^DIRECTORY B:")
+            (let* ((start (line-beginning-position))
+                   (end (line-end-position))
+                   (directory-b (buffer-substring-no-properties start end)))
+              (setq directory-b (replace-regexp-in-string "DIRECTORY B: " "" 
directory-b))
+
+              (while (and (> (line-number-at-pos) 1)
+                          (not (looking-at "^DIRECTORY A:")))
+                (forward-line -1))
+              (when (looking-at "^DIRECTORY A:")
                 (let* ((start (line-beginning-position))
                        (end (line-end-position))
-                       (directory-b (buffer-substring-no-properties start 
end)))
-                  (setq directory-b (replace-regexp-in-string "DIRECTORY B: " 
"" directory-b))
-
-                  (while (and (> (line-number-at-pos) 1)
-                              (not (looking-at "^DIRECTORY A:")))
-                    (forward-line -1))
-                  (if (looking-at "^DIRECTORY A:")
-                      (let* ((start (line-beginning-position))
-                             (end (line-end-position))
-                             (directory-a (buffer-substring-no-properties 
start end)))
-                        (setq directory-a (replace-regexp-in-string "DIRECTORY 
A: " "" directory-a))
-                        (list file section directory-a directory-b))))))))))
+                       (directory-a (buffer-substring-no-properties start 
end)))
+                  (setq directory-a (replace-regexp-in-string "DIRECTORY A: " 
"" directory-a))
+                  (list file section directory-a directory-b))))))))))
 
 (defun ssh-deploy-diff-mode--action-handler (action)
   "Route valid ACTION to their functions."
   (interactive)
   (let ((parts (ssh-deploy-diff-mode--get-parts)))
-    (if (not (eq parts nil))
-        (cond
-         ((null parts) (message "Found nothing to do"))
-         ((not (or (nth 0 parts)
-                   ;; FIXME: Comparing equality of functions is bad karma!
-                   (eq action #'ssh-deploy-diff-mode--refresh)))
-          (message "Found nothing to do in the section for action %s"
-                   (replace-regexp-in-string "ssh-deploy-diff-mode--" ""
-                                             (format "%s" action))))
-         (t (funcall action parts))))))
+    (when (not (eq parts nil))
+      (cond
+       ((null parts) (message "Found nothing to do"))
+       ((not (or (nth 0 parts)
+                 ;; FIXME: Comparing equality of functions is bad karma!
+                 (eq action #'ssh-deploy-diff-mode--refresh)))
+        (message "Found nothing to do in the section for action %s"
+                 (replace-regexp-in-string "ssh-deploy-diff-mode--" ""
+                                           (format "%s" action))))
+       (t (funcall action parts))))))
 
 (defun ssh-deploy-diff-mode--refresh (parts)
   "Refresh current difference query based on PARTS."
@@ -192,8 +192,8 @@
     (pcase section
       ('in-both
        (let ((yes-no-prompt (read-string (format "Type 'yes' to confirm that 
you want to delete the file '%s': " file-name))))
-         (if (string= yes-no-prompt "yes")
-             (ssh-deploy-delete-both path-local))))
+         (when (string= yes-no-prompt "yes")
+           (ssh-deploy-delete-both path-local))))
       ('only-in-a
        (ssh-deploy-delete path-local))
       ('only-in-b
diff --git a/ssh-deploy.el b/ssh-deploy.el
index e3b4332..f686e31 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -432,15 +432,14 @@
                  (when ssh-deploy-verbose (message (nth 1 return)))
                (display-warning 'ssh-deploy (nth 1 return) :warning)))
            async-with-threads))
-      (progn
-        (when ssh-deploy-verbose (message "Uploading directory '%s' to '%s'.. 
(asynchronously)" path-local path-remote))
-        (ssh-deploy--async-process
-         (lambda()
-           (copy-directory path-local path-remote t t t)
-           path-local)
-         (lambda(return-path)
-           (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle return-path)
-           (when ssh-deploy-verbose (message "Completed upload of directory 
'%s'. (asynchronously)" return-path))))))))
+      (when ssh-deploy-verbose (message "Uploading directory '%s' to '%s'.. 
(asynchronously)" path-local path-remote))
+      (ssh-deploy--async-process
+       (lambda()
+         (copy-directory path-local path-remote t t t)
+         path-local)
+       (lambda(return-path)
+         (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-idle 
return-path)
+         (when ssh-deploy-verbose (message "Completed upload of directory 
'%s'. (asynchronously)" return-path)))))))
 
 (defun ssh-deploy--upload-via-tramp (path-local path-remote force 
revision-folder)
   "Upload PATH-LOCAL to PATH-REMOTE via TRAMP synchronously and FORCE despite 
remote change compared with copy in REVISION-FOLDER."
@@ -464,11 +463,10 @@
                 (display-warning 'ssh-deploy (format "Remote file '%s' has 
changed, please download or diff. (synchronously)" path-remote) :warning))
             (display-warning 'ssh-deploy "Function 'ediff-same-file-contents' 
is missing." :warning))
           (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle))
-      (progn
-        (when ssh-deploy-verbose (message "Uploading directory '%s' to '%s'.. 
(synchronously)" path-local path-remote))
-        (copy-directory path-local path-remote t t t)
-        (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-idle)
-        (when ssh-deploy-verbose (message "Completed upload of '%s'. 
(synchronously)" path-local))))))
+      (when ssh-deploy-verbose (message "Uploading directory '%s' to '%s'.. 
(synchronously)" path-local path-remote))
+      (copy-directory path-local path-remote t t t)
+      (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-idle)
+      (when ssh-deploy-verbose (message "Completed upload of '%s'. 
(synchronously)" path-local)))))
 
 (defun ssh-deploy--download-via-tramp-async (path-remote path-local 
revision-folder async-with-threads)
   "Download PATH-REMOTE to PATH-LOCAL via TRAMP asynchronously and make a copy 
in REVISION-FOLDER, use multi-threading if ASYNC-WITH-THREADS is above zero."
@@ -508,11 +506,10 @@
           (ssh-deploy-store-revision path-local revision-folder)
           (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-idle)
           (when ssh-deploy-verbose (message "Completed download of file '%s'. 
(synchronously)" path-local)))
-      (progn
-        (message "Downloading directory '%s' to '%s'.. (synchronously)" 
path-remote path-local)
-        (copy-directory path-remote path-local t t t)
-        (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-idle)
-        (message "Completed download of directory '%s'. (synchronously)" 
path-local)))))
+      (message "Downloading directory '%s' to '%s'.. (synchronously)" 
path-remote path-local)
+      (copy-directory path-remote path-local t t t)
+      (ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-idle)
+      (message "Completed download of directory '%s'. (synchronously)" 
path-local))))
 
 (defun ssh-deploy--diff-directories-data (directory-a directory-b exclude-list)
   "Find difference between DIRECTORY-A and DIRECTORY-B but exclude paths 
matching EXCLUDE-LIST."
@@ -542,16 +539,16 @@
 
                    ;; Check if file is excluded
                    (dolist (element exclude-list)
-                     (if (and (not (null element))
-                              (not (null (string-match element 
relative-path))))
-                         (setq included nil)))
-
-                   (if included
-                       (progn
-                         (puthash relative-path file-a files-a-relative-hash)
-                         (if (equal files-a-relative-list nil)
-                             (setq files-a-relative-list (list relative-path))
-                           (push relative-path files-a-relative-list)))))))
+                     (when (and (not (null element))
+                                (not (null (string-match element 
relative-path))))
+                       (setq included nil)))
+
+                   (when included
+                     (progn
+                       (puthash relative-path file-a files-a-relative-hash)
+                       (if (equal files-a-relative-list nil)
+                           (setq files-a-relative-list (list relative-path))
+                         (push relative-path files-a-relative-list)))))))
              files-a)
 
             ;; Collected included files in directory b with relative paths
@@ -564,16 +561,15 @@
 
                    ;; Check if file is excluded
                    (dolist (element exclude-list)
-                     (if (and (not (null element))
-                              (not (null (string-match element 
relative-path))))
-                         (setq included nil)))
-
-                   (if included
-                       (progn
-                         (puthash relative-path file-b files-b-relative-hash)
-                         (if (equal files-b-relative-list nil)
-                             (setq files-b-relative-list (list relative-path))
-                           (push relative-path files-b-relative-list)))))))
+                     (when (and (not (null element))
+                                (not (null (string-match element 
relative-path))))
+                       (setq included nil)))
+
+                   (when included
+                     (puthash relative-path file-b files-b-relative-hash)
+                     (if (equal files-b-relative-list nil)
+                         (setq files-b-relative-list (list relative-path))
+                       (push relative-path files-b-relative-list))))))
              files-b)
 
             ;; Collect files that only exists in directory a and files that 
exist in both directory a and b
@@ -591,29 +587,28 @@
             ;; Collect files that only exists in directory b
             (mapc
              (lambda (file-b)
-               (if (equal (gethash file-b files-a-relative-hash) nil)
-                   (progn
-                     ;; (message "%s did not exist in hash-a" file-b)
-                     (if (equal files-b-only nil)
-                         (setq files-b-only (list file-b))
-                       (push file-b files-b-only)))))
+               (when (equal (gethash file-b files-a-relative-hash) nil)
+                 ;; (message "%s did not exist in hash-a" file-b)
+                 (if (equal files-b-only nil)
+                     (setq files-b-only (list file-b))
+                   (push file-b files-b-only))))
              files-b-relative-list)
 
             ;; Collect files that differ in contents and have equal contents
             (require 'ediff-util)
-            (if (fboundp 'ediff-same-file-contents)
-                (mapc
-                 (lambda (file)
-                   (let ((file-a (gethash file files-a-relative-hash))
-                         (file-b (gethash file files-b-relative-hash)))
-                     (if (ediff-same-file-contents file-a file-b)
-                         (if (equal files-both-equals nil)
-                             (setq files-both-equals (list file))
-                           (push file files-both-equals))
-                       (if (equal files-both-differs nil)
-                           (setq files-both-differs (list file))
-                         (push file files-both-differs)))))
-                 files-both))
+            (when (fboundp 'ediff-same-file-contents)
+              (mapc
+               (lambda (file)
+                 (let ((file-a (gethash file files-a-relative-hash))
+                       (file-b (gethash file files-b-relative-hash)))
+                   (if (ediff-same-file-contents file-a file-b)
+                       (if (equal files-both-equals nil)
+                           (setq files-both-equals (list file))
+                         (push file files-both-equals))
+                     (if (equal files-both-differs nil)
+                         (setq files-both-differs (list file))
+                       (push file files-both-differs)))))
+               files-both))
 
             (list directory-a directory-b exclude-list files-both files-a-only 
files-b-only files-both-equals files-both-differs))
         (display-warning 'ssh-deploy "Both directories need to exist to 
perform difference generation." :warning))
@@ -631,36 +626,32 @@
     (ssh-deploy--insert-keyword "DIRECTORY B: ")
     (insert (nth 1 diff) "\n")
 
-    (if (> (length (nth 2 diff)) 0)
-        (progn
-          (insert "\n")
-          (ssh-deploy--insert-keyword (format "EXCLUDE-LIST: (%d)" (length 
(nth 2 diff))))
-          (dolist (element (nth 2 diff))
-            (insert "\n- " element))
-          (insert "\n")))
+    (when (> (length (nth 2 diff)) 0)
+      (insert "\n")
+      (ssh-deploy--insert-keyword (format "EXCLUDE-LIST: (%d)" (length (nth 2 
diff))))
+      (dolist (element (nth 2 diff))
+        (insert "\n- " element))
+      (insert "\n"))
 
     (insert "\n")
 
-    (if (> (length (nth 4 diff)) 0)
-        (progn
-          (ssh-deploy--insert-keyword (format "FILES ONLY IN A: (%d)" (length 
(nth 4 diff))))
-          (dolist (element (nth 4 diff))
-            (insert "\n- " element))
-          (insert "\n\n")))
+    (when (> (length (nth 4 diff)) 0)
+      (ssh-deploy--insert-keyword (format "FILES ONLY IN A: (%d)" (length (nth 
4 diff))))
+      (dolist (element (nth 4 diff))
+        (insert "\n- " element))
+      (insert "\n\n"))
 
-    (if (> (length (nth 5 diff)) 0)
-        (progn
-          (ssh-deploy--insert-keyword (format "FILES ONLY IN B: (%d)" (length 
(nth 5 diff))))
-          (dolist (element (nth 5 diff))
-            (insert "\n- " element))
-          (insert "\n\n")))
+    (when (> (length (nth 5 diff)) 0)
+      (ssh-deploy--insert-keyword (format "FILES ONLY IN B: (%d)" (length (nth 
5 diff))))
+      (dolist (element (nth 5 diff))
+        (insert "\n- " element))
+      (insert "\n\n"))
 
-    (if (> (length (nth 7 diff)) 0)
-        (progn
-          (ssh-deploy--insert-keyword (format "FILES IN BOTH BUT DIFFERS: 
(%d)" (length (nth 7 diff))))
-          (dolist (element (nth 7 diff))
-            (insert "\n- " element))
-          (insert "\n\n")))
+    (when (> (length (nth 7 diff)) 0)
+      (ssh-deploy--insert-keyword (format "FILES IN BOTH BUT DIFFERS: (%d)" 
(length (nth 7 diff))))
+      (dolist (element (nth 7 diff))
+        (insert "\n- " element))
+      (insert "\n\n"))
 
     (insert "\nHELP: quit (q), copy (C), copy A to B (a), copy B to A (b), 
delete (D), difference (TAB), refresh (g), open (RET)")
 
@@ -716,15 +707,14 @@
              (ssh-deploy--diff-directories-data directory-a directory-b 
exclude-list))
            (lambda(diff)
              (message "Completed calculation of differences between directory 
'%s' and '%s'. Result: %s only in A %s only in B %s differs. (asynchronously)" 
(nth 0 diff) (nth 1 diff) (length (nth 4 diff)) (length (nth 5 diff)) (length 
(nth 7 diff)))
-             (if (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)) 0) 
(> (length (nth 7 diff)) 0))
-                 (ssh-deploy--diff-directories-present diff directory-a 
directory-b on-explicit-save debug async async-with-threads revision-folder 
remote-changes exclude-list)))
+             (when (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)) 0) 
(> (length (nth 7 diff)) 0))
+               (ssh-deploy--diff-directories-present diff directory-a 
directory-b on-explicit-save debug async async-with-threads revision-folder 
remote-changes exclude-list)))
            async-with-threads))
-      (progn
-        (message "Calculating differences between directory '%s' and '%s'.. 
(synchronously)" directory-a directory-b)
-        (let ((diff (ssh-deploy--diff-directories-data directory-a directory-b 
exclude-list)))
-          (message "Completed calculation of differences between directory 
'%s' and '%s'. Result: %s only in A, %s only in B, %s differs. (synchronously)" 
(nth 0 diff) (nth 1 diff) (length (nth 4 diff)) (length (nth 5 diff)) (length 
(nth 7 diff)))
-          (if (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)) 0) (> 
(length (nth 7 diff)) 0))
-              (ssh-deploy--diff-directories-present diff directory-a 
directory-b on-explicit-save debug async async-with-threads revision-folder 
remote-changes exclude-list)))))))
+      (message "Calculating differences between directory '%s' and '%s'.. 
(synchronously)" directory-a directory-b)
+      (let ((diff (ssh-deploy--diff-directories-data directory-a directory-b 
exclude-list)))
+        (message "Completed calculation of differences between directory '%s' 
and '%s'. Result: %s only in A, %s only in B, %s differs. (synchronously)" (nth 
0 diff) (nth 1 diff) (length (nth 4 diff)) (length (nth 5 diff)) (length (nth 7 
diff)))
+        (when (or (> (length (nth 4 diff)) 0) (> (length (nth 5 diff)) 0) (> 
(length (nth 7 diff)) 0))
+          (ssh-deploy--diff-directories-present diff directory-a directory-b 
on-explicit-save debug async async-with-threads revision-folder remote-changes 
exclude-list))))))
 
 ;;;###autoload
 (defun ssh-deploy-remote-changes (path-local &optional root-local root-remote 
async revision-folder exclude-list async-with-threads)
@@ -781,24 +771,23 @@
                            async-with-threads))
 
                       ;; Async is not enabled - synchronous logic here
-                      (progn
 
-                        ;; Update buffer status
-                        (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-detecting-remote-changes)
+                      ;; Update buffer status
+                      (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-detecting-remote-changes)
 
-                        ;; Does remote file exist?
-                        (if (file-exists-p path-remote)
-                            (progn
-                              (require 'ediff-util)
-                              (if (fboundp 'ediff-same-file-contents)
-                                  (if (ediff-same-file-contents revision-path 
path-remote)
-                                      (when ssh-deploy-verbose (message 
"Remote file '%s' has not changed. (synchronously)" path-remote))
-                                    (display-warning 'ssh-deploy (format 
"Remote file '%s' has changed, please download or diff. (synchronously)" 
path-remote) :warning))
-                                (display-warning 'ssh-deploy "Function 
'ediff-same-file-contents' is missing. (synchronously)" :warning)))
-                          (when ssh-deploy-verbose (message "Remote file '%s' 
doesn't exist. (synchronously)" path-remote)))
+                      ;; Does remote file exist?
+                      (if (file-exists-p path-remote)
+                          (progn
+                            (require 'ediff-util)
+                            (if (fboundp 'ediff-same-file-contents)
+                                (if (ediff-same-file-contents revision-path 
path-remote)
+                                    (when ssh-deploy-verbose (message "Remote 
file '%s' has not changed. (synchronously)" path-remote))
+                                  (display-warning 'ssh-deploy (format "Remote 
file '%s' has changed, please download or diff. (synchronously)" path-remote) 
:warning))
+                              (display-warning 'ssh-deploy "Function 
'ediff-same-file-contents' is missing. (synchronously)" :warning)))
+                        (when ssh-deploy-verbose (message "Remote file '%s' 
doesn't exist. (synchronously)" path-remote)))
 
-                        ;; Update buffer status to idle
-                        (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle)))
+                      ;; Update buffer status to idle
+                      (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle))
 
                   ;; Does not have local revision. Is async enabled?
                   (if (> async 0)
@@ -834,26 +823,25 @@
                          async-with-threads))
 
                     ;; Async is not enabled - synchronous logic here
-                    (progn
 
-                      ;; Update buffer status
-                      (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-detecting-remote-changes)
+                    ;; Update buffer status
+                    (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-detecting-remote-changes)
 
-                      ;; Does remote file exist?
-                      (if (file-exists-p path-remote)
-                          (progn
-                            (require 'ediff-util)
-                            (if (fboundp 'ediff-same-file-contents)
-                                (if (ediff-same-file-contents path-local 
path-remote)
-                                    (progn
-                                      (copy-file path-local revision-path t t 
t t)
-                                      (when ssh-deploy-verbose (message 
"Remote file '%s' has not changed, created base revision. (synchronously)" 
path-remote)))
-                                  (display-warning 'ssh-deploy (format "Remote 
file '%s' has changed, please download or diff. (synchronously)" path-remote) 
:warning))
-                              (display-warning 'ssh-deploy "Function 
'ediff-same-file-contents' is missing. (synchronously)" :warning)))
-                        (when ssh-deploy-verbose (message "Remote file '%s' 
does not exist. (synchronously)" path-remote)))
-
-                      ;; Update buffer status to idle
-                      (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle)))))
+                    ;; Does remote file exist?
+                    (if (file-exists-p path-remote)
+                        (progn
+                          (require 'ediff-util)
+                          (if (fboundp 'ediff-same-file-contents)
+                              (if (ediff-same-file-contents path-local 
path-remote)
+                                  (progn
+                                    (copy-file path-local revision-path t t t 
t)
+                                    (when ssh-deploy-verbose (message "Remote 
file '%s' has not changed, created base revision. (synchronously)" 
path-remote)))
+                                (display-warning 'ssh-deploy (format "Remote 
file '%s' has changed, please download or diff. (synchronously)" path-remote) 
:warning))
+                            (display-warning 'ssh-deploy "Function 
'ediff-same-file-contents' is missing. (synchronously)" :warning)))
+                      (when ssh-deploy-verbose (message "Remote file '%s' does 
not exist. (synchronously)" path-remote)))
+
+                    ;; Update buffer status to idle
+                    (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle))))
 
             ;; File is a directory
             (when (> ssh-deploy-debug 0) (message "File %s is a directory, 
ignoring remote changes check." path-local))))
@@ -949,12 +937,11 @@
                  (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle (nth 2 files))
                  (message "Renamed '%s' to '%s'. (asynchronously)" (nth 0 
files) (nth 1 files)))
                async-with-threads)
-            (progn
-              (rename-file old-path-remote new-path-remote t)
-              (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle)
-              (message "Renamed '%s' to '%s'. (synchronously)" old-path-remote 
new-path-remote))))
-      (if (> debug 0)
-          (message "Path '%s' or '%s' is not in the root '%s' or is excluded 
from it." old-path-local new-path-local root-local)))))
+            (rename-file old-path-remote new-path-remote t)
+            (ssh-deploy--mode-line-set-status-and-update 
ssh-deploy--status-idle)
+            (message "Renamed '%s' to '%s'. (synchronously)" old-path-remote 
new-path-remote)))
+      (when (> debug 0)
+        (message "Path '%s' or '%s' is not in the root '%s' or is excluded 
from it." old-path-local new-path-local root-local)))))
 
 ;;;###autoload
 (defun ssh-deploy-remote-sql (remote-path &optional type)
@@ -986,11 +973,11 @@
   (let ((root-local (or root-local ssh-deploy-root-local))
         (root-remote (or root-remote ssh-deploy-root-remote))
         (exclude-list (or exclude-list ssh-deploy-exclude-list)))
-    (if (and (ssh-deploy--file-is-in-path path-local root-local)
-             (ssh-deploy--file-is-included path-local exclude-list))
-        (let ((path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) root-remote)))
-          (message "Opening '%s' for browsing on remote host.." path-remote)
-          (dired path-remote)))))
+    (when (and (ssh-deploy--file-is-in-path path-local root-local)
+               (ssh-deploy--file-is-included path-local exclude-list))
+      (let ((path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) root-remote)))
+        (message "Opening '%s' for browsing on remote host.." path-remote)
+        (dired path-remote)))))
 
 ;;;###autoload
 (defun ssh-deploy-remote-terminal-eshell (path-local &optional root-local 
root-remote exclude-list)
@@ -1027,11 +1014,11 @@
 ;;;###autoload
 (defun ssh-deploy-store-revision (path &optional root)
   "Store PATH in revision-folder ROOT."
-  (if (not (file-directory-p path))
-      (let* ((root (or root ssh-deploy-revision-folder))
-             (revision-path (ssh-deploy--get-revision-path path root)))
-        (when ssh-deploy-verbose (message "Storing revision of '%s' at '%s'.." 
path revision-path))
-        (copy-file path revision-path t t t t))))
+  (when (not (file-directory-p path))
+    (let* ((root (or root ssh-deploy-revision-folder))
+           (revision-path (ssh-deploy--get-revision-path path root)))
+      (when ssh-deploy-verbose (message "Storing revision of '%s' at '%s'.." 
path revision-path))
+      (copy-file path revision-path t t t t))))
 
 ;;;###autoload
 (defun ssh-deploy-diff (path-local path-remote &optional root-local debug 
exclude-list async async-with-threads on-explicit-save revision-folder 
remote-changes)
@@ -1084,23 +1071,23 @@
 (defun ssh-deploy-upload-handler (&optional force)
   "Upload current path to remote if it is configured for deployment and if 
remote version hasn't changed or FORCE is specified."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (let ((root-local (file-truename ssh-deploy-root-local))
-            (force (or force 0))
-            path-local)
-        (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
-                 (file-exists-p buffer-file-name))
-            (setq path-local (file-truename buffer-file-name))
-          (if (and (ssh-deploy--is-not-empty-string default-directory)
-                   (file-exists-p default-directory))
-              (setq path-local (file-truename default-directory))))
-        (if (and (ssh-deploy--is-not-empty-string path-local)
-                 (ssh-deploy--file-is-in-path path-local root-local)
-                 (ssh-deploy--file-is-included path-local 
ssh-deploy-exclude-list))
-            (let ((path-remote (expand-file-name 
(ssh-deploy--get-relative-path root-local path-local) ssh-deploy-root-remote)))
-              (ssh-deploy-upload path-local path-remote force ssh-deploy-async 
ssh-deploy-revision-folder ssh-deploy-async-with-threads))
-          (when (> ssh-deploy-debug 0) (message "Ignoring upload, path '%s' is 
empty, not in the root '%s' or is excluded from it." path-local root-local))))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (let ((root-local (file-truename ssh-deploy-root-local))
+          (force (or force 0))
+          path-local)
+      (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
+               (file-exists-p buffer-file-name))
+          (setq path-local (file-truename buffer-file-name))
+        (if (and (ssh-deploy--is-not-empty-string default-directory)
+                 (file-exists-p default-directory))
+            (setq path-local (file-truename default-directory))))
+      (if (and (ssh-deploy--is-not-empty-string path-local)
+               (ssh-deploy--file-is-in-path path-local root-local)
+               (ssh-deploy--file-is-included path-local 
ssh-deploy-exclude-list))
+          (let ((path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) ssh-deploy-root-remote)))
+            (ssh-deploy-upload path-local path-remote force ssh-deploy-async 
ssh-deploy-revision-folder ssh-deploy-async-with-threads))
+        (when (> ssh-deploy-debug 0) (message "Ignoring upload, path '%s' is 
empty, not in the root '%s' or is excluded from it." path-local root-local))))))
 
 ;;;###autoload
 (defun ssh-deploy-upload-handler-forced ()
@@ -1138,160 +1125,160 @@
 (defun ssh-deploy-open-remote-file-handler()
   "Check if local revision exists or remote file has changed if path is 
configured for deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
-           (ssh-deploy--is-not-empty-string buffer-file-name))
-      (let* ((root-local (file-truename ssh-deploy-root-local))
-             (path-local (file-truename buffer-file-name))
-             (path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) ssh-deploy-root-remote)))
-        (when ssh-deploy-verbose (message "Opening file on remote '%s'" 
path-remote))
-        (find-file path-remote))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
+             (ssh-deploy--is-not-empty-string buffer-file-name))
+    (let* ((root-local (file-truename ssh-deploy-root-local))
+           (path-local (file-truename buffer-file-name))
+           (path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) ssh-deploy-root-remote)))
+      (when ssh-deploy-verbose (message "Opening file on remote '%s'" 
path-remote))
+      (find-file path-remote))))
 
 ;;;###autoload
 (defun ssh-deploy-download-handler ()
   "Download current path from remote if it is configured for deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (let ((root-local (file-truename ssh-deploy-root-local))
-            path-local)
-        (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
-                 (file-exists-p buffer-file-name))
-            (setq path-local (file-truename buffer-file-name))
-          (if (and (ssh-deploy--is-not-empty-string default-directory)
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (let ((root-local (file-truename ssh-deploy-root-local))
+          path-local)
+      (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
+               (file-exists-p buffer-file-name))
+          (setq path-local (file-truename buffer-file-name))
+        (when (and (ssh-deploy--is-not-empty-string default-directory)
                    (file-exists-p default-directory))
-              (setq path-local (file-truename default-directory))))
-        (if (and (ssh-deploy--is-not-empty-string path-local)
-                 (ssh-deploy--file-is-in-path path-local root-local)
-                 (ssh-deploy--file-is-included path-local 
ssh-deploy-exclude-list))
-            (let ((path-remote (expand-file-name 
(ssh-deploy--get-relative-path root-local path-local) ssh-deploy-root-remote)))
-              (ssh-deploy-download path-remote path-local ssh-deploy-async 
ssh-deploy-revision-folder ssh-deploy-async-with-threads))
-          (when (> ssh-deploy-debug 0) (message "Ignoring upload, path '%s' is 
empty, not in the root '%s' or is excluded from it." path-local root-local))))))
+          (setq path-local (file-truename default-directory))))
+      (if (and (ssh-deploy--is-not-empty-string path-local)
+               (ssh-deploy--file-is-in-path path-local root-local)
+               (ssh-deploy--file-is-included path-local 
ssh-deploy-exclude-list))
+          (let ((path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) ssh-deploy-root-remote)))
+            (ssh-deploy-download path-remote path-local ssh-deploy-async 
ssh-deploy-revision-folder ssh-deploy-async-with-threads))
+        (when (> ssh-deploy-debug 0) (message "Ignoring upload, path '%s' is 
empty, not in the root '%s' or is excluded from it." path-local root-local))))))
 
 ;;;###autoload
 (defun ssh-deploy-diff-handler ()
   "Compare current path with remote host if it is configured for deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
-               (file-exists-p buffer-file-name))
-          (let* ((path-local (file-truename buffer-file-name))
-                 (root-local (file-truename ssh-deploy-root-local))
-                 (path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) ssh-deploy-root-remote)))
-            (ssh-deploy-diff path-local path-remote root-local 
ssh-deploy-debug ssh-deploy-exclude-list ssh-deploy-async 
ssh-deploy-async-with-threads ssh-deploy-on-explicit-save 
ssh-deploy-revision-folder ssh-deploy-automatically-detect-remote-changes))
-        (if (and (ssh-deploy--is-not-empty-string default-directory)
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
+             (file-exists-p buffer-file-name))
+        (let* ((path-local (file-truename buffer-file-name))
+               (root-local (file-truename ssh-deploy-root-local))
+               (path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) ssh-deploy-root-remote)))
+          (ssh-deploy-diff path-local path-remote root-local ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async ssh-deploy-async-with-threads 
ssh-deploy-on-explicit-save ssh-deploy-revision-folder 
ssh-deploy-automatically-detect-remote-changes))
+      (when (and (ssh-deploy--is-not-empty-string default-directory)
                  (file-exists-p default-directory))
-            (let* ((path-local (file-truename default-directory))
-                   (root-local (file-truename ssh-deploy-root-local))
-                   (path-remote (expand-file-name 
(ssh-deploy--get-relative-path root-local path-local) ssh-deploy-root-remote)))
-              (ssh-deploy-diff path-local path-remote root-local 
ssh-deploy-debug ssh-deploy-exclude-list ssh-deploy-async 
ssh-deploy-async-with-threads ssh-deploy-on-explicit-save 
ssh-deploy-revision-folder ssh-deploy-automatically-detect-remote-changes))))))
+        (let* ((path-local (file-truename default-directory))
+               (root-local (file-truename ssh-deploy-root-local))
+               (path-remote (expand-file-name (ssh-deploy--get-relative-path 
root-local path-local) ssh-deploy-root-remote)))
+          (ssh-deploy-diff path-local path-remote root-local ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async ssh-deploy-async-with-threads 
ssh-deploy-on-explicit-save ssh-deploy-revision-folder 
ssh-deploy-automatically-detect-remote-changes))))))
 
 ;;;###autoload
 (defun ssh-deploy-delete-handler ()
   "Delete current file or directory."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
-               (file-exists-p buffer-file-name))
-          (let* ((path-local (file-truename buffer-file-name))
-                 (root-local (file-truename ssh-deploy-root-local))
-                 (yes-no-prompt (read-string (format "Type 'yes' to confirm 
that you want to delete the file '%s': " path-local))))
-            (if (string= yes-no-prompt "yes")
-                (ssh-deploy-delete-both path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))
-        (if (and (ssh-deploy--is-not-empty-string default-directory)
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
+             (file-exists-p buffer-file-name))
+        (let* ((path-local (file-truename buffer-file-name))
+               (root-local (file-truename ssh-deploy-root-local))
+               (yes-no-prompt (read-string (format "Type 'yes' to confirm that 
you want to delete the file '%s': " path-local))))
+          (when (string= yes-no-prompt "yes")
+            (ssh-deploy-delete-both path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))
+      (when (and (ssh-deploy--is-not-empty-string default-directory)
                  (file-exists-p default-directory))
-            (let* ((path-local (file-truename default-directory))
-                   (root-local (file-truename ssh-deploy-root-local))
-                   (yes-no-prompt (read-string (format "Type 'yes' to confirm 
that you want to delete the directory '%s': " path-local))))
-              (if (string= yes-no-prompt "yes")
-                  (ssh-deploy-delete-both path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))))))
+        (let* ((path-local (file-truename default-directory))
+               (root-local (file-truename ssh-deploy-root-local))
+               (yes-no-prompt (read-string (format "Type 'yes' to confirm that 
you want to delete the directory '%s': " path-local))))
+          (when (string= yes-no-prompt "yes")
+            (ssh-deploy-delete-both path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))))))
 
 ;;;###autoload
 (defun ssh-deploy-rename-handler ()
   "Rename current file or directory."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
-               (file-exists-p buffer-file-name))
-          (let* ((old-path-local (file-truename buffer-file-name))
-                 (root-local (file-truename ssh-deploy-root-local))
-                 (basename (file-name-nondirectory old-path-local))
-                 (new-path-local-tmp (read-file-name "New file name:" 
(file-name-directory old-path-local) basename nil basename))
-                 (new-path-local (file-truename new-path-local-tmp)))
-            (if (not (string= old-path-local new-path-local))
-                (ssh-deploy-rename old-path-local new-path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))
-        (if (and (ssh-deploy--is-not-empty-string default-directory)
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (if (and (ssh-deploy--is-not-empty-string buffer-file-name)
+             (file-exists-p buffer-file-name))
+        (let* ((old-path-local (file-truename buffer-file-name))
+               (root-local (file-truename ssh-deploy-root-local))
+               (basename (file-name-nondirectory old-path-local))
+               (new-path-local-tmp (read-file-name "New file name:" 
(file-name-directory old-path-local) basename nil basename))
+               (new-path-local (file-truename new-path-local-tmp)))
+          (when (not (string= old-path-local new-path-local))
+            (ssh-deploy-rename old-path-local new-path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))
+      (when (and (ssh-deploy--is-not-empty-string default-directory)
                  (file-exists-p default-directory))
-            (let* ((old-path-local (file-truename default-directory))
-                   (root-local (file-truename ssh-deploy-root-local))
-                   (basename (file-name-nondirectory old-path-local))
-                   (new-path-local-tmp (read-file-name "New directory name:" 
(file-name-directory old-path-local) basename nil basename))
-                   (new-path-local (file-truename new-path-local-tmp)))
-              (if (not (string= old-path-local new-path-local))
-                  (ssh-deploy-rename old-path-local new-path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))))))
+        (let* ((old-path-local (file-truename default-directory))
+               (root-local (file-truename ssh-deploy-root-local))
+               (basename (file-name-nondirectory old-path-local))
+               (new-path-local-tmp (read-file-name "New directory name:" 
(file-name-directory old-path-local) basename nil basename))
+               (new-path-local (file-truename new-path-local-tmp)))
+          (when (not (string= old-path-local new-path-local))
+            (ssh-deploy-rename old-path-local new-path-local root-local 
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug 
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))))))
 
 ;;;###autoload
 (defun ssh-deploy-remote-terminal-eshell-handler ()
   "Open current relative path on remote host in `eshell' but only if it's 
configured for deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
-           (ssh-deploy--is-not-empty-string default-directory))
-      (let ((path-local (file-truename default-directory))
-            (root-local (file-truename ssh-deploy-root-local)))
-        (ssh-deploy-remote-terminal-eshell path-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
+             (ssh-deploy--is-not-empty-string default-directory))
+    (let ((path-local (file-truename default-directory))
+          (root-local (file-truename ssh-deploy-root-local)))
+      (ssh-deploy-remote-terminal-eshell path-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
 
 ;;;###autoload
 (defun ssh-deploy-remote-terminal-eshell-base-handler ()
   "Open base path on remote host in `eshell' but only if it's configured for 
deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (let ((root-local (file-truename ssh-deploy-root-local)))
-        (ssh-deploy-remote-terminal-eshell root-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (let ((root-local (file-truename ssh-deploy-root-local)))
+      (ssh-deploy-remote-terminal-eshell root-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
 
 ;;;###autoload
 (defun ssh-deploy-remote-terminal-shell-handler ()
   "Open current relative path on remote host in `eshell' but only if it's 
configured for deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
-           (ssh-deploy--is-not-empty-string default-directory))
-      (let ((path-local (file-truename default-directory))
-            (root-local (file-truename ssh-deploy-root-local)))
-        (ssh-deploy-remote-terminal-shell path-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
+             (ssh-deploy--is-not-empty-string default-directory))
+    (let ((path-local (file-truename default-directory))
+          (root-local (file-truename ssh-deploy-root-local)))
+      (ssh-deploy-remote-terminal-shell path-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
 
 ;;;###autoload
 (defun ssh-deploy-remote-terminal-shell-base-handler ()
   "Open base path on remote host in `eshell' but only if it's configured for 
deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (let ((root-local (file-truename ssh-deploy-root-local)))
-        (ssh-deploy-remote-terminal-shell root-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (let ((root-local (file-truename ssh-deploy-root-local)))
+      (ssh-deploy-remote-terminal-shell root-local root-local 
ssh-deploy-root-remote ssh-deploy-exclude-list))))
 
 ;;;###autoload
 (defun ssh-deploy-browse-remote-handler ()
   "Open current relative path on remote host in `dired-mode' if it is 
configured for deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
-           (ssh-deploy--is-not-empty-string default-directory))
-      (let ((path-local (file-truename default-directory))
-            (root-local (file-truename ssh-deploy-root-local)))
-        (ssh-deploy-browse-remote path-local root-local ssh-deploy-root-remote 
ssh-deploy-exclude-list))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote)
+             (ssh-deploy--is-not-empty-string default-directory))
+    (let ((path-local (file-truename default-directory))
+          (root-local (file-truename ssh-deploy-root-local)))
+      (ssh-deploy-browse-remote path-local root-local ssh-deploy-root-remote 
ssh-deploy-exclude-list))))
 
 ;;;###autoload
 (defun ssh-deploy-browse-remote-base-handler ()
   "Open base path on remote host in `dired-mode' if it is configured for 
deployment."
   (interactive)
-  (if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
-           (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
-      (let ((root-local (file-truename ssh-deploy-root-local)))
-        (ssh-deploy-browse-remote root-local root-local ssh-deploy-root-remote 
ssh-deploy-exclude-list))))
+  (when (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
+             (ssh-deploy--is-not-empty-string ssh-deploy-root-remote))
+    (let ((root-local (file-truename ssh-deploy-root-local)))
+      (ssh-deploy-browse-remote root-local root-local ssh-deploy-root-remote 
ssh-deploy-exclude-list))))
 
 ;;;###autoload
 (defun ssh-deploy-run-deploy-script-handler ()
@@ -1309,10 +1296,9 @@
                           (funcall ,ssh-deploy-script)))
              (lambda(result) (message "Completed execution of 
deployment-script. Return: '%s' (asynchronously)" result))
              ssh-deploy-async-with-threads))
-        (progn
-          (message "Executing of deployment-script starting... 
(synchronously)")
-          (let ((ret (funcall ssh-deploy-script)))
-            (message "Completed execution of deployment-script. Return: '%s' 
(synchronously)" ret))))
+        (message "Executing of deployment-script starting... (synchronously)")
+        (let ((ret (funcall ssh-deploy-script)))
+          (message "Completed execution of deployment-script. Return: '%s' 
(synchronously)" ret)))
     (display-warning 'ssh-deploy "ssh-deploy-script lacks definition!" 
:warning)))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]