+2013-02-18 Michael Albinus <michael.albinus@gmx.de>
+
+ * 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.
+
2013-02-16 Didier Verna <didier@didierverna.net>
* net/network-stream.el (network-stream-open-starttls):
(defun eshell/su (&rest args)
"Alias \"su\" to call Tramp."
+ (require 'tramp)
(setq args (eshell-stringify-list (eshell-flatten-list args)))
(let ((orig-args (copy-tree args)))
(eshell-eval-using-options
(defun eshell/sudo (&rest args)
"Alias \"sudo\" to call Tramp."
+ (require 'tramp)
(setq args (eshell-stringify-list (eshell-flatten-list args)))
(let ((orig-args (copy-tree args)))
(eshell-eval-using-options
(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.
- (ignore (file-exists-p default-directory))
(eshell-named-command (car orig-args) (cdr orig-args))))))))
(put 'eshell/sudo 'eshell-no-numeric-conversions t)
(or (null program) tramp-process-connection-type))
(bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
(name1 name)
- (i 0))
+ (i 0)
+ ;; We do not want to raise an error when
+ ;; `start-file-process' has been started several time in
+ ;; `eshell' and friends.
+ (tramp-current-connection nil))
(unless buffer
;; BUFFER can be nil. We use a temporary buffer.