emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/shell.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/shell.el,v
Date: Wed, 22 Aug 2007 19:47:58 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/08/22 19:47:57

Index: shell.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/shell.el,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -b -r1.152 -r1.153
--- shell.el    26 Jul 2007 05:26:33 -0000      1.152
+++ shell.el    22 Aug 2007 19:47:57 -0000      1.153
@@ -511,6 +511,9 @@
 (defun shell (&optional buffer)
   "Run an inferior shell, with I/O through BUFFER (which defaults to 
`*shell*').
 Interactively, a prefix arg means to prompt for BUFFER.
+If `default-directory' is a remote file name, it is also prompted
+to change if called with a prefix arg.
+
 If BUFFER exists but shell process is not running, make new shell.
 If BUFFER exists and shell process is running, just switch to BUFFER.
 Program used comes from variable `explicit-shell-file-name',
@@ -540,7 +543,14 @@
    (list
     (and current-prefix-arg
         (read-buffer "Shell buffer: "
-                     (generate-new-buffer-name "*shell*")))))
+                     (generate-new-buffer-name "*shell*"))
+        (file-remote-p default-directory)
+        ;; It must be possible to declare a local default-directory.
+        (setq default-directory
+              (expand-file-name
+               (read-file-name
+                "Default directory: " default-directory default-directory
+                t nil 'file-directory-p))))))
   (setq buffer (get-buffer-create (or buffer "*shell*")))
   ;; 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).




reply via email to

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