diff options
| author | Tom Tromey <tromey@redhat.com> | 2012-09-04 10:10:06 -0600 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2012-09-04 10:10:06 -0600 |
| commit | bf69f522a9e135f9aa483cedd53e71e915f2bf75 (patch) | |
| tree | 3f73c47fb863ef87f420de1d30858da821072bd9 /lisp/eshell | |
| parent | 303324a9232dbc89369faceb6b3530740d0fc1bd (diff) | |
| parent | 6ec9a5a7b5efb129807f567709ca858211ed7840 (diff) | |
| download | emacs-bf69f522a9e135f9aa483cedd53e71e915f2bf75.tar.gz | |
merge from trunk
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-unix.el | 2 | ||||
| -rw-r--r-- | lisp/eshell/esh-ext.el | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 35f7a0a9e3d..58402e37508 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -1110,6 +1110,8 @@ Execute a COMMAND as the superuser or another USER.") (format "%s|sudo:%s@%s:%s" (substring prefix 0 -1) user host dir) (format "/sudo:%s@%s:%s" user host dir)))) + ;; Ensure, that Tramp has connected to that construct already. + (file-exists-p default-directory) (eshell-named-command (car orig-args) (cdr orig-args)))))))) (put 'eshell/sudo 'eshell-no-numeric-conversions t) diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 52df1587d5f..e48213c54d6 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -207,9 +207,14 @@ causing the user to wonder if anything's really going on..." (defun eshell-external-command (command args) "Insert output from an external COMMAND, using ARGS." (setq args (eshell-stringify-list (eshell-flatten-list args))) - ;; (if (file-remote-p default-directory) - ;; (eshell-remote-command command args)) - (let ((interp (eshell-find-interpreter command))) + (let ((interp (eshell-find-interpreter + command + ;; `eshell-find-interpreter' does not work correctly + ;; for Tramp file name syntax. But we don't need to + ;; know the interpreter in that case, therefore the + ;; check is suppressed. + (or (and (stringp command) (file-remote-p command)) + (file-remote-p default-directory))))) (cl-assert interp) (if (functionp (car interp)) (apply (car interp) (append (cdr interp) args)) |
