diff options
| author | Glenn Morris | 2013-02-18 19:29:28 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-02-18 19:29:28 -0800 |
| commit | 872faefb07a9196a583fc8cbe146ab6a2ebc9c2b (patch) | |
| tree | 5502bf8472fb7d132c03de2240ce403b502f8995 /lisp/eshell | |
| parent | 8ca4f1e02e22f74dc269b01bc4a32e01dd226dae (diff) | |
| parent | 2af3b9c16e340ad034e57e949f09bbafc00bd52c (diff) | |
| download | emacs-872faefb07a9196a583fc8cbe146ab6a2ebc9c2b.tar.gz emacs-872faefb07a9196a583fc8cbe146ab6a2ebc9c2b.zip | |
Merge from emacs-24; up to 2012-12-20T16:09:05Z!dmantipov@yandex.ru
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-unix.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index f6dd0d5e990..94508d71592 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -1040,6 +1040,7 @@ Show wall-clock time elapsed during execution of COMMAND.") | |||
| 1040 | 1040 | ||
| 1041 | (defun eshell/su (&rest args) | 1041 | (defun eshell/su (&rest args) |
| 1042 | "Alias \"su\" to call Tramp." | 1042 | "Alias \"su\" to call Tramp." |
| 1043 | (require 'tramp) | ||
| 1043 | (setq args (eshell-stringify-list (eshell-flatten-list args))) | 1044 | (setq args (eshell-stringify-list (eshell-flatten-list args))) |
| 1044 | (let ((orig-args (copy-tree args))) | 1045 | (let ((orig-args (copy-tree args))) |
| 1045 | (eshell-eval-using-options | 1046 | (eshell-eval-using-options |
| @@ -1077,6 +1078,7 @@ Become another USER during a login session.") | |||
| 1077 | 1078 | ||
| 1078 | (defun eshell/sudo (&rest args) | 1079 | (defun eshell/sudo (&rest args) |
| 1079 | "Alias \"sudo\" to call Tramp." | 1080 | "Alias \"sudo\" to call Tramp." |
| 1081 | (require 'tramp) | ||
| 1080 | (setq args (eshell-stringify-list (eshell-flatten-list args))) | 1082 | (setq args (eshell-stringify-list (eshell-flatten-list args))) |
| 1081 | (let ((orig-args (copy-tree args))) | 1083 | (let ((orig-args (copy-tree args))) |
| 1082 | (eshell-eval-using-options | 1084 | (eshell-eval-using-options |
| @@ -1111,8 +1113,6 @@ Execute a COMMAND as the superuser or another USER.") | |||
| 1111 | (format "%s|sudo:%s@%s:%s" | 1113 | (format "%s|sudo:%s@%s:%s" |
| 1112 | (substring prefix 0 -1) user host dir) | 1114 | (substring prefix 0 -1) user host dir) |
| 1113 | (format "/sudo:%s@%s:%s" user host dir)))) | 1115 | (format "/sudo:%s@%s:%s" user host dir)))) |
| 1114 | ;; Ensure, that Tramp has connected to that construct already. | ||
| 1115 | (ignore (file-exists-p default-directory)) | ||
| 1116 | (eshell-named-command (car orig-args) (cdr orig-args)))))))) | 1116 | (eshell-named-command (car orig-args) (cdr orig-args)))))))) |
| 1117 | 1117 | ||
| 1118 | (put 'eshell/sudo 'eshell-no-numeric-conversions t) | 1118 | (put 'eshell/sudo 'eshell-no-numeric-conversions t) |