emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109607: * net/tramp-sh.el (tramp-ope


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109607: * net/tramp-sh.el (tramp-open-shell): Cache the shell name.
Date: Tue, 14 Aug 2012 16:48:28 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109607
committer: Michael Albinus <address@hidden
branch nick: trunk
timestamp: Tue 2012-08-14 16:48:28 +0200
message:
  * net/tramp-sh.el (tramp-open-shell): Cache the shell name.
  (tramp-find-shell, tramp-open-connection-setup-interactive-shell):
  Use cached shell name.
modified:
  lisp/ChangeLog
  lisp/net/tramp-sh.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-08-14 13:39:27 +0000
+++ b/lisp/ChangeLog    2012-08-14 14:48:28 +0000
@@ -1,3 +1,9 @@
+2012-08-14  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-open-shell): Cache the shell name.
+       (tramp-find-shell, tramp-open-connection-setup-interactive-shell):
+       Use cached shell name.
+
 2012-08-14  Fabián Ezequiel Gallina  <address@hidden>
 
        * progmodes/python.el (python-shell-send-string):

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2012-08-08 13:40:45 +0000
+++ b/lisp/net/tramp-sh.el      2012-08-14 14:48:28 +0000
@@ -3599,11 +3599,14 @@
        (setq item (pop alist))
        (when (string-match (car item) shell)
          (setq extra-args (cdr item))))
-      (when extra-args (setq shell (concat shell " " extra-args)))
       (tramp-send-command
-       vec (format "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s"
-                  (tramp-shell-quote-argument tramp-end-of-output) shell)
+       vec (format
+           "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"
+           (tramp-shell-quote-argument tramp-end-of-output)
+           shell (or extra-args ""))
        t))
+    (tramp-set-connection-property
+     (tramp-get-connection-process vec) "remote-shell" shell)
     ;; Setting prompts.
     (tramp-send-command
      vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t)
@@ -3614,8 +3617,12 @@
 (defun tramp-find-shell (vec)
   "Opens a shell on the remote host which groks tilde expansion."
   (with-current-buffer (tramp-get-buffer vec)
-    (let ((default-shell (tramp-get-method-parameter
-                         (tramp-file-name-method vec) 'tramp-remote-shell))
+    (let ((default-shell
+           (or
+            (tramp-get-connection-property
+             (tramp-get-connection-process vec) "remote-shell" nil)
+            (tramp-get-method-parameter
+             (tramp-file-name-method vec) 'tramp-remote-shell)))
          shell)
       (setq shell
            (with-connection-property vec "remote-shell"
@@ -3692,8 +3699,9 @@
     ;; discarded as well.
     (tramp-open-shell
      vec
-     (tramp-get-method-parameter
-      (tramp-file-name-method vec) 'tramp-remote-shell))
+     (or (tramp-get-connection-property vec "remote-shell" nil)
+        (tramp-get-method-parameter
+         (tramp-file-name-method vec) 'tramp-remote-shell)))
 
     ;; Disable echo.
     (tramp-message vec 5 "Setting up remote shell environment")


reply via email to

[Prev in Thread] Current Thread [Next in Thread]