aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorMichael Albinus2013-02-18 20:13:21 +0100
committerMichael Albinus2013-02-18 20:13:21 +0100
commitc9bcc580e8286ee32840dae5aacdcc930cfee2da (patch)
tree753cddc456fb8abb8ef4a7a966e93b5b607657a0 /lisp/eshell
parent17ddfd150ff1d84021342ee82ff53b5860579252 (diff)
downloademacs-c9bcc580e8286ee32840dae5aacdcc930cfee2da.tar.gz
emacs-c9bcc580e8286ee32840dae5aacdcc930cfee2da.zip
* eshell/em-unix.el (eshell/su): Require tramp.
(eshell/sudo): Require tramp. Remove now unnecessary check. * net/tramp-sh.el (tramp-sh-handle-start-file-process): Let-bind `tramp-current-connection' in order to avoid an error when several commands are invoked in a short time in eshell and friends.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/em-unix.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 9e061b64504..b387a8ba974 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -1039,6 +1039,7 @@ Show wall-clock time elapsed during execution of COMMAND.")
1039 1039
1040(defun eshell/su (&rest args) 1040(defun eshell/su (&rest args)
1041 "Alias \"su\" to call Tramp." 1041 "Alias \"su\" to call Tramp."
1042 (require 'tramp)
1042 (setq args (eshell-stringify-list (eshell-flatten-list args))) 1043 (setq args (eshell-stringify-list (eshell-flatten-list args)))
1043 (let ((orig-args (copy-tree args))) 1044 (let ((orig-args (copy-tree args)))
1044 (eshell-eval-using-options 1045 (eshell-eval-using-options
@@ -1076,6 +1077,7 @@ Become another USER during a login session.")
1076 1077
1077(defun eshell/sudo (&rest args) 1078(defun eshell/sudo (&rest args)
1078 "Alias \"sudo\" to call Tramp." 1079 "Alias \"sudo\" to call Tramp."
1080 (require 'tramp)
1079 (setq args (eshell-stringify-list (eshell-flatten-list args))) 1081 (setq args (eshell-stringify-list (eshell-flatten-list args)))
1080 (let ((orig-args (copy-tree args))) 1082 (let ((orig-args (copy-tree args)))
1081 (eshell-eval-using-options 1083 (eshell-eval-using-options
@@ -1110,8 +1112,6 @@ Execute a COMMAND as the superuser or another USER.")
1110 (format "%s|sudo:%s@%s:%s" 1112 (format "%s|sudo:%s@%s:%s"
1111 (substring prefix 0 -1) user host dir) 1113 (substring prefix 0 -1) user host dir)
1112 (format "/sudo:%s@%s:%s" user host dir)))) 1114 (format "/sudo:%s@%s:%s" user host dir))))
1113 ;; Ensure, that Tramp has connected to that construct already.
1114 (ignore (file-exists-p default-directory))
1115 (eshell-named-command (car orig-args) (cdr orig-args)))))))) 1115 (eshell-named-command (car orig-args) (cdr orig-args))))))))
1116 1116
1117(put 'eshell/sudo 'eshell-no-numeric-conversions t) 1117(put 'eshell/sudo 'eshell-no-numeric-conversions t)