[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy f4ad77d 026/173: Now works asynchrously, mo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy f4ad77d 026/173: Now works asynchrously, moved (revert-buffer) to successful downloads instead of to key-binding. |
Date: |
Sat, 20 Oct 2018 10:36:24 -0400 (EDT) |
branch: externals/ssh-deploy
commit f4ad77d18f3bc72dadc9e08916140dce07809fd8
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Now works asynchrously, moved (revert-buffer) to successful downloads
instead of to key-binding.
---
README.md | 2 +-
ssh-deploy.el | 48 +++++++++++++++++++++++++++++++-----------------
2 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index e3f0363..bdc3fb4 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ This application is made by Christian Johansson
<address@hidden> 2016 and is l
:config
(add-hook 'after-save-hook (lambda() (if ssh-deploy-on-explicit-save
(ssh-deploy-upload-handler)) ))
(global-set-key (kbd "C-c C-z u") (lambda()
(interactive)(ssh-deploy-upload-handler) ))
- (global-set-key (kbd "C-c C-z d") (lambda()
(interactive)(ssh-deploy-download-handler)(revert-buffer) ))
+ (global-set-key (kbd "C-c C-z d") (lambda()
(interactive)(ssh-deploy-download-handler) ))
(global-set-key (kbd "C-c C-z x") (lambda()
(interactive)(ssh-deploy-diff-handler) ))
(global-set-key (kbd "C-c C-z t") (lambda()
(interactive)(ssh-deploy-remote-terminal-handler) ))
(global-set-key (kbd "C-c C-z b") (lambda()
(interactive)(ssh-deploy-browse-remote-handler) )))
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 783be76..44a181f 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -3,8 +3,8 @@
;; Author: Christian Johansson <github.com/cjohansson>
;; Maintainer: Christian Johansson <github.com/cjohansson>
;; Created: 5 Jul 2016
-;; Modified: 20 Jul 2016
-;; Version: 1.22
+;; Modified: 9 Aug 2016
+;; Version: 1.3
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -43,7 +43,7 @@
;;
;; - To set key-bindings do something like this:
;; (global-set-key (kbd "C-c C-z u") (lambda()
(interactive)(ssh-deploy-upload-handler) ))
-;; (global-set-key (kbd "C-c C-z d") (lambda()
(interactive)(ssh-deploy-download-handler)(revert-buffer) ))
+;; (global-set-key (kbd "C-c C-z d") (lambda()
(interactive)(ssh-deploy-download-handler) ))
;; (global-set-key (kbd "C-c C-z x") (lambda()
(interactive)(ssh-deploy-diff-handler) ))
;; (global-set-key (kbd "C-c C-z t") (lambda()
(interactive)(ssh-deploy-remote-terminal-handler) ))
;; (global-set-key (kbd "C-c C-z b") (lambda()
(interactive)(ssh-deploy-browse-remote-handler) ))
@@ -147,16 +147,21 @@
(progn
(let ((command (concat "scp " (shell-quote-argument
path) " " (shell-quote-argument remote-path))))
(message "Upload command: '%s'" command)
- (if (= (shell-command command) 0)
- (message "Successfully uploaded file '%s' to
'%s'" path remote-path)
- (message "Failed to upload file '%s' to '%s'" path
remote-path))))
+ (let ((proc (start-process-shell-command "process"
nil command)))
+ (set-process-sentinel proc (lambda (proc output)
+ (if (string=
(symbol-name (process-status proc)) "exit")
+ (if (=
(process-exit-status proc) 0)
+ (message
"Successfully uploaded file.")
+ (message "Failed
to upload file."))))))))
(progn
(let ((command (concat "scp -r " (shell-quote-argument
path) " " (shell-quote-argument (file-name-directory (directory-file-name
remote-path))))))
(message "Upload command: '%s'" command)
- (if (= (shell-command command) 0)
- (message "Successfully uploaded directory '%s' to
'%s'" path (file-name-directory (directory-file-name remote-path)))
- (message "Failed to upload directory '%s' to '%s'"
path (file-name-directory (directory-file-name remote-path))))))
- ))
+ (let ((proc (start-process-shell-command "process" nil
command)))
+ (set-process-sentinel proc (lambda (proc output)
+ (if (string= (symbol-name
(process-status proc)) "exit")
+ (if (=
(process-exit-status proc) 0)
+ (message
"Successfully uploaded directory.")
+ (message "Failed to
upload directory"))))))))))
(progn
(message "Downloading path '%s' to '%s'.." remote-path path)
(if file-or-directory
@@ -164,17 +169,26 @@
(message "Downloading file '%s' to '%s'.." remote-path
path)
(let ((command (concat "scp " (shell-quote-argument
remote-path) " " (shell-quote-argument path))))
(message "Download command: '%s'" command)
- (if (= (shell-command command) 0)
- (message "Successfully downloaded file '%s' to
'%s'" remote-path path)
- (message "Failed to download file '%s' to '%s'"
remote-path path))))
+ (let ((proc (start-process-shell-command "process" nil
command)))
+ (set-process-sentinel proc (lambda (proc output)
+ (if (string= (symbol-name
(process-status proc)) "exit")
+ (if (=
(process-exit-status proc) 0)
+ (progn
+ (message
"Successfully downloaded file.")
+ (revert-buffer))
+ (message "Failed to
download file."))))))))
(progn
(message "Downloading directory '%s' to '%s'.."
remote-path path)
(let ((command (concat "scp -r " (shell-quote-argument
remote-path) " " (shell-quote-argument (file-name-directory
(directory-file-name path))))))
(message "Download command: '%s'" command)
- (if (= (shell-command command) 0)
- (message "Successfully downloaded directory '%s' to
'%s'" remote-path (file-name-directory (directory-file-name path)))
- (message "Failed to download directory '%s' to '%s'"
remote-path (file-name-directory (directory-file-name path))))))
- ))))
+ (let ((proc (start-process-shell-command "process" nil
command)))
+ (set-process-sentinel proc (lambda (proc output)
+ (if (string= (symbol-name
(process-status proc)) "exit")
+ (if (=
(process-exit-status proc) 0)
+ (progn
+ (message
"Successfully downloaded directory.")
+ (revert-buffer))
+ (message "Failed to
download directory."))))))))))))
(if ssh-deploy-debug
(message "Path '%s' is not in the root '%s'" path local-root))))))
- [elpa] externals/ssh-deploy 952abf0 021/173: Changed reference to zdiff-tree to ztree-diff and added more checks to see if tramp-term is installed before calling it., (continued)
- [elpa] externals/ssh-deploy 952abf0 021/173: Changed reference to zdiff-tree to ztree-diff and added more checks to see if tramp-term is installed before calling it., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 3fbd479 013/173: Changed variable-name typo explicity-save to explicit-save and updated README., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 7133863 024/173: Fixed typos, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 8faa3c1 018/173: Now checks in path is in local-root before browsing remote host., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 3bbbbfb 017/173: *** empty log message ***, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy f77eba5 012/173: Updated README with proper setup example and instructions about MELPA., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 5ad07f2 008/173: Changed requirements., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 1ebf003 010/173: Formatted text a bit better., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy ebdbb7e 014/173: Add TRAMP protocol for difference queries, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy fa368fb 020/173: Made relative path generation as stand-alone function and now checks if ztree and tramp-term is installed before trying to call them., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy f4ad77d 026/173: Now works asynchrously, moved (revert-buffer) to successful downloads instead of to key-binding.,
Stefan Monnier <=
- [elpa] externals/ssh-deploy 05ed4c8 009/173: Made changes to comply with MELPA guidelines., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 89fb82a 038/173: Fixed bug when downloading via SSH to a local path containing whitespaces, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 965c68f 028/173: Centralized asynchronous shell commands., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy e6e1ad8 039/173: Updated version and modified date, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 2257f95 029/173: Fixed upload and downloads of root directories where local root directory name differs from remote root directory name., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 560ff1d 037/173: Added TRAMP functions and improved messages., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy a86091c 032/173: Broken down diff function into multiple functions to easily add new protocols., Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 1e58dc3 040/173: SSH deployment now works via TRAMP instead of SCP, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 4a2f947 053/173: Fixed bug where missing remote file used wrong logic, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 61a16be 047/173: Merged remote, Stefan Monnier, 2018/10/20