[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy e0bf686 054/133: More (if), (when) and (prog
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy e0bf686 054/133: More (if), (when) and (progn) optimizations |
Date: |
Sat, 27 Mar 2021 14:48:42 -0400 (EDT) |
branch: externals/ssh-deploy
commit e0bf68680545dd9bcedf27cdede5ce8b6ae4ed3d
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
More (if), (when) and (progn) optimizations
---
ssh-deploy.el | 50 +++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 95cb65c..a2cfa38 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -299,20 +299,20 @@
(if finish
(funcall finish result)))))))
(if (fboundp 'async-start)
- (if start
- (let ((ftp-netrc nil))
- (when (boundp 'ange-ftp-netrc-filename)
- (setq ftp-netrc ange-ftp-netrc-filename))
- (async-start
- (lambda()
- (let ((ssh-deploy-async 0)
- (ssh-deploy-async-with-threads 0)
- (ssh-deploy-on-explicit-save 0)
- (ssh-deploy-automatically-detect-remote-changes 0))
- (if ftp-netrc
- (defvar ange-ftp-netrc-filename ftp-netrc))
- (funcall start)))
- finish)))
+ (when start
+ (let ((ftp-netrc nil))
+ (when (boundp 'ange-ftp-netrc-filename)
+ (setq ftp-netrc ange-ftp-netrc-filename))
+ (async-start
+ (lambda()
+ (let ((ssh-deploy-async 0)
+ (ssh-deploy-async-with-threads 0)
+ (ssh-deploy-on-explicit-save 0)
+ (ssh-deploy-automatically-detect-remote-changes 0))
+ (if ftp-netrc
+ (defvar ange-ftp-netrc-filename ftp-netrc))
+ (funcall start)))
+ finish)))
(display-warning 'ssh-deploy "Neither make-thread nor async-start
functions are available!"))))
(defun ssh-deploy--mode-line-set-status-and-update (status &optional filename)
@@ -392,9 +392,9 @@
"Return non-nil if PATH is not in EXCLUDE-LIST."
(let ((not-found t))
(dolist (element exclude-list)
- (if (and (not (null element))
- (not (null (string-match element path))))
- (setq not-found nil)))
+ (when (and (not (null element))
+ (not (null (string-match element path))))
+ (setq not-found nil)))
not-found))
(defun ssh-deploy--get-relative-path (root path)
@@ -419,7 +419,7 @@
(if (fboundp 'ediff-same-file-contents)
(if (or (> force 0) (not (file-exists-p path-remote)) (and
(file-exists-p revision-path) (ediff-same-file-contents revision-path
path-remote)))
(progn
- (if (not (file-directory-p (file-name-directory
path-remote)))
+ (when (not (file-directory-p (file-name-directory
path-remote)))
(make-directory (file-name-directory path-remote)
t))
(copy-file path-local path-remote t t t t)
(copy-file path-local revision-path t t t t)
@@ -455,8 +455,8 @@
(and (file-exists-p revision-path)
(ediff-same-file-contents revision-path path-remote)))
(progn
(when ssh-deploy-verbose (message "Uploading file '%s' to
'%s'.. (synchronously)" path-local path-remote))
- (if (not (file-directory-p (file-name-directory
path-remote)))
- (make-directory (file-name-directory path-remote) t))
+ (when (not (file-directory-p (file-name-directory
path-remote)))
+ (make-directory (file-name-directory path-remote) t))
(copy-file path-local path-remote t t t t)
(ssh-deploy-store-revision path-local revision-folder)
(when ssh-deploy-verbose (message "Completed upload of
'%s'. (synchronously)" path-local)))
@@ -478,7 +478,7 @@
(let ((file-or-directory (not (file-directory-p path-remote))))
(if file-or-directory
(progn
- (if (not (file-directory-p (file-name-directory path-local)))
+ (when (not (file-directory-p (file-name-directory path-local)))
(make-directory (file-name-directory path-local) t))
(copy-file path-remote path-local t t t t)
(copy-file path-local revision-path t t t t))
@@ -500,7 +500,7 @@
(if file-or-directory
(progn
(when ssh-deploy-verbose (message "Downloading file '%s' to '%s'..
(synchronously)" path-remote path-local))
- (if (not (file-directory-p (file-name-directory path-local)))
+ (when (not (file-directory-p (file-name-directory path-local)))
(make-directory (file-name-directory path-local) t))
(copy-file path-remote path-local t t t t)
(ssh-deploy-store-revision path-local revision-folder)
@@ -1079,9 +1079,9 @@
(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))))
+ (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))
- [elpa] externals/ssh-deploy d0f7294 121/133: When remote differs only with local-revision, update local-revision [#61], (continued)
- [elpa] externals/ssh-deploy d0f7294 121/133: When remote differs only with local-revision, update local-revision [#61], Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e133963 125/133: Default exclude value for DirectoryVariables now matches only .dir-locals.el, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 168c66d 114/133: Updated .gitignore to ignore test-generated files, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 93a0e18 128/133: Resolved hydra declaration if hydra is not installed, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 89bb950 131/133: Merge pull request #69 from housensen/patch-1, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 7a5a087 066/133: Updated version, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 664f52c 072/133: Improved missing async function error and replaced require with autoload, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8c354e1 092/133: Added Travis CI file to repo, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy f61f1ef 041/133: Fixed bug where all DirectoryVariables was not passed on from handlers, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy a1a9d3c 051/133: Work on lisp code styling with (if), (progn) and (when), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e0bf686 054/133: More (if), (when) and (progn) optimizations,
Stefan Monnier <=
- [elpa] externals/ssh-deploy efc8be3 058/133: Added another example using plug-in functions from script, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 4044f78 064/133: Hydra compilation working, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy ae5354a 065/133: Fixed issue were remote paths with symlinks didn't work with recursive diff function, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 6e37aae 067/133: Added unit test for download, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8107b9e 073/133: Added unit test for rename and delete, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e895d6d 079/133: Replaced asynchronous (require) with (autoload), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 5846974 082/133: Added instructions about how to trigger unit test with async.el integration, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 85a7c37 080/133: Added unit tests for asynchronous operations, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 6ddb12b 090/133: All unit tests for remote changes sync and async and compilation passing, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8e2507b 085/133: Refactored remote changes function and made unit tests for it, Stefan Monnier, 2021/03/27