]> code.delx.au - gnu-emacs/commitdiff
* eshell/em-unix.el (eshell/sudo): When we have an ad-hoc
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 2 Sep 2012 09:57:19 +0000 (11:57 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 2 Sep 2012 09:57:19 +0000 (11:57 +0200)
remote definition of `default-directory', ensure we can connect.

lisp/ChangeLog
lisp/eshell/em-unix.el

index b56672ac84f03da658d2088b3f599deb8ea301d1..62d3097ccaafa64589a4a225c9f05c9cbf3fc1af 100644 (file)
@@ -1,3 +1,8 @@
+2012-09-02  Michael Albinus  <michael.albinus@gmx.de>
+
+       * 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  <juri@jurta.org>
 
        Toggle whitespace matching mode with M-s SPC.
index 35f7a0a9e3d08e3af15f051f61678cf05742fac0..58402e375081a479bac54d5f10239fcd1f80f273 100644 (file)
@@ -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)