From: Michael Albinus Date: Sun, 2 Sep 2012 09:57:19 +0000 (+0200) Subject: * eshell/em-unix.el (eshell/sudo): When we have an ad-hoc X-Git-Tag: emacs-24.2.90~435 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=73406194024fcb6877db0618300b63916ebf466d;p=emacs.git * eshell/em-unix.el (eshell/sudo): When we have an ad-hoc remote definition of `default-directory', ensure we can connect. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b56672ac84f..62d3097ccaa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-02 Michael Albinus + + * eshell/em-unix.el (eshell/sudo): When we have an ad-hoc + remote definition of `default-directory', ensure we can connect. + 2012-09-02 Juri Linkov Toggle whitespace matching mode with M-s SPC. 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)