[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy a724653 077/173: Added support for launching
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy a724653 077/173: Added support for launching remote eshell |
Date: |
Sat, 20 Oct 2018 10:36:34 -0400 (EDT) |
branch: externals/ssh-deploy
commit a7246531ab3d3c2d7cb3bd515353dfecbe5902c1
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Added support for launching remote eshell
---
README.md | 3 +++
ssh-deploy.el | 28 ++++++++++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 5245ceb..5995f2c 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@ The `ssh-deploy` plug-in for Emacs makes it possible to
effortlessly deploy loca
* Manual downloads and uploads of directories and files
* Automatic and manual detection of remote changes of files
* Launch remote terminals with the integrated `tramp-term` functionality (if
it's installed) (SSH)
+* Launch remote `eshell` terminals (SSH, FTP)
* Launch remote browsing using `dired-mode`
* Launch difference sessions using `ediff-mode`
* Supports asynchronous operations if `async.el` is installed. (You need to
setup an automatic authorization for this, like `~/.netrc` or key-based
authorization)
@@ -96,6 +97,7 @@ Set your user and group as owner and file permissions to
`700`. Emacs should now
(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 T") (lambda()
(interactive)(ssh-deploy-remote-terminal-eshell-handler) ))
(global-set-key (kbd "C-c C-z R") (lambda()
(interactive)(ssh-deploy-rename-handler) ))
(global-set-key (kbd "C-c C-z e") (lambda()
(interactive)(ssh-deploy-remote-changes-handler) ))
(global-set-key (kbd "C-c C-z b") (lambda()
(interactive)(ssh-deploy-browse-remote-handler) )))
@@ -112,6 +114,7 @@ You can remove the `add-to-list` line if you installed via
`MELPA` repository.
* If you press `C-c C-z d` you will download the current file or directory
from remote host and then reload current buffer.
* If you press `C-c C-z D` you will delete the current file or directory after
a confirmation on local and remote host.
* If you press `C-c C-z t` you will open a terminal with remote host via
`tramp-term`.
+* If you press `C-c C-z T` you will open a terminal with remote host via
`eshell`.
* If you press `C-c C-z b` you will browse current directory on remote host in
`dired-mode`.
* If you press `C-c C-z R` you will rename current file or directory.
* If you press `C-c C-z e` you will check for remote changes to the current
file.
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 8372101..5ea249d 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: 25 Jul 2017
-;; Version: 1.59
+;; Modified: 1 Aug 2017
+;; Version: 1.6
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -63,6 +63,7 @@
;; (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 T") (lambda()
(interactive)(ssh-deploy-remote-terminal-eshell-handler) ))
;; (global-set-key (kbd "C-c C-z R") (lambda()
(interactive)(ssh-deploy-rename-handler) ))
;; (global-set-key (kbd "C-c C-z e") (lambda()
(interactive)(ssh-deploy-remote-changes-handler) ))
;; (global-set-key (kbd "C-c C-z b") (lambda()
(interactive)(ssh-deploy-browse-remote-handler) ))
@@ -526,6 +527,19 @@
(dired command))))))
;;;### autoload
+(defun ssh-deploy-remote-terminal-eshell (local-root remote-root-string path)
+ "Browse relative to LOCAL-ROOT on REMOTE-ROOT-STRING the path PATH in
`dired-mode`."
+ (if (and (ssh-deploy--file-is-in-path path local-root)
+ (ssh-deploy--file-is-included path))
+ (let ((remote-path (concat remote-root-string
(ssh-deploy--get-relative-path local-root path))))
+ (let ((remote-root (ssh-deploy--parse-remote remote-path)))
+ (let ((command (concat "/" (alist-get 'protocol remote-root) ":"
(alist-get 'username remote-root) "@" (alist-get 'server remote-root) ":"
(alist-get 'path remote-root))))
+ (let ((old-directory default-directory))
+ (message "Opening eshell on '%s'.." command)
+ (cd command)
+ (eshell)))))))
+
+;;;### autoload
(defun ssh-deploy-remote-terminal (remote-host-string)
"Opens REMOTE-HOST-STRING in terminal."
(let ((remote-root (ssh-deploy--parse-remote remote-host-string)))
@@ -715,6 +729,16 @@
(ssh-deploy-remote-terminal ssh-deploy-root-remote)))
;;;### autoload
+(defun ssh-deploy-remote-terminal-eshell-handler ()
+ "Open current relative path on remote host in `shell' but only if it's
configured for deployment."
+ (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 ((local-path (file-truename default-directory))
+ (local-root (file-truename ssh-deploy-root-local)))
+ (ssh-deploy-remote-terminal-eshell local-root ssh-deploy-root-remote
local-path))))
+
+;;;### autoload
(defun ssh-deploy-browse-remote-handler ()
"Open current relative path on remote host in `dired-mode' if it is
configured for deployment."
(if (and (ssh-deploy--is-not-empty-string ssh-deploy-root-local)
- [elpa] externals/ssh-deploy 57f8638 167/173: Fixed issue were no run script was defined, (continued)
- [elpa] externals/ssh-deploy 57f8638 167/173: Fixed issue were no run script was defined, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 8ed82d6 060/173: Added force upload handler, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy b53b875 078/173: Improved remote eshell integration, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 08d5778 083/173: Added example hydra to README, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 5e0403c 085/173: Instructions for FTP in macOS 10.13, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 0d8b5de 095/173: Only open directory diff buffer if there was any differences, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 407402d 100/173: Improved documentation about interaction-free password-based authentication, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy d0b45f4 106/173: Fixed typos in readme, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 6f54fd5 110/173: Fixed bug where upload file into folder that does not exist on remote, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 9d6d8a4 136/173: Improved comments, trying to trigger MELPA refresh, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy a724653 077/173: Added support for launching remote eshell,
Stefan Monnier <=
- [elpa] externals/ssh-deploy 2226edb 088/173: Merge branch 'master' of https://github.com/cjohansson/emacs-ssh-deploy, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 72a5033 081/173: Moved safe variables declaration to plugin, made handler functions, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy d5315bf 080/173: Fix syntax notices and now restores eshell buffer name, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 454af97 070/173: Added delete function for files and directories, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 5cd1f80 092/173: Improved code for detecting remote changes, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy e56b316 113/173: Fixed syntax error in (cond) expression, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 5442a7e 104/173: Removed dependency package, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 99727db 125/173: Updated completed deletion messages for more salience, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy c193330 107/173: Optimized (progn) structures, Stefan Monnier, 2018/10/20
- [elpa] externals/ssh-deploy 8d99eb6 130/173: Updated version, Stefan Monnier, 2018/10/20