]> git.eshelyaron.com Git - emacs.git/commitdiff
* shell.el (shell): When called interactively, offer to change the
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 14 Mar 2011 09:53:13 +0000 (10:53 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 14 Mar 2011 09:53:13 +0000 (10:53 +0100)
shell file name on remote hosts.

lisp/ChangeLog
lisp/shell.el

index c74e7cbdb2d2d2650f4964f0bc2f90e8095b179e..b36be6f3a094fd04072bbe0f89031764a73f5d4d 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-14  Michael Albinus  <michael.albinus@gmx.de>
+
+       * shell.el (shell): When called interactively, offer to change the
+       shell file name on remote hosts.
+
 2011-03-13  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * net/ldap.el (ldap-search-internal): Add `auth-source-search'
index bceea990bafcac917daac0e4b6c7197f7307eca9..dde81c6cb95f46ed739ce2f7d01699b0abc47a70 100644 (file)
@@ -583,6 +583,21 @@ Otherwise, one argument `-i' is passed to the shell.
                    (get-buffer-create (or buffer "*shell*"))
                  ;; If the current buffer is a dead shell buffer, use it.
                  (current-buffer)))
+
+  ;; On remote hosts, the local `shell-file-name' might be useless.
+  (if (and (interactive-p)
+          (file-remote-p default-directory)
+          (null explicit-shell-file-name)
+          (null (getenv "ESHELL")))
+      (with-current-buffer buffer
+       (set (make-local-variable 'explicit-shell-file-name)
+            (file-remote-p
+             (expand-file-name
+              (read-file-name
+               "Remote shell path: " default-directory shell-file-name
+               t shell-file-name))
+             'localname))))
+
   ;; Pop to buffer, so that the buffer's window will be correctly set
   ;; when we call comint (so that comint sets the COLUMNS env var properly).
   (pop-to-buffer buffer)