changeset 82765:a8c46cf3e7aa

* comint.el (comint-exec-1): Raise an error if `start-file-process' does not return a process object. * shell.el (shell): Prompt for `default-directory' if it is a remote file name, and if called with a prefix arg.
author Michael Albinus <michael.albinus@gmx.de>
date Wed, 22 Aug 2007 19:47:57 +0000
parents c865c404d660
children 44b579ee06d5
files lisp/ChangeLog lisp/comint.el lisp/shell.el
diffstat 3 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Aug 22 19:47:53 2007 +0000
+++ b/lisp/ChangeLog	Wed Aug 22 19:47:57 2007 +0000
@@ -1,3 +1,11 @@
+2007-08-22  Michael Albinus  <michael.albinus@gmx.de>
+
+	* comint.el (comint-exec-1): Raise an error if
+	`start-file-process' does not return a process object.
+
+	* shell.el (shell): Prompt for `default-directory' if it is a
+	remote file name, and if called with a prefix arg.
+
 2007-08-22  Sam Steingold  <sds@gnu.org>
 
 	* pcvs.el (cvs-vc-command-advice): Fix a typo in code (file->files).
--- a/lisp/comint.el	Wed Aug 22 19:47:53 2007 +0000
+++ b/lisp/comint.el	Wed Aug 22 19:47:57 2007 +0000
@@ -783,6 +783,8 @@
 			 ;; first look relative to the current directory.
 			 (cons default-directory exec-path) exec-path)))
       (setq proc (apply 'start-file-process name buffer command switches)))
+    ;; Some file name handler cannot start a process, fe ange-ftp.
+    (unless (processp proc) (error "No process started"))
     (let ((coding-systems (process-coding-system proc)))
       (setq decoding (car coding-systems)
 	    encoding (cdr coding-systems)))
--- a/lisp/shell.el	Wed Aug 22 19:47:53 2007 +0000
+++ b/lisp/shell.el	Wed Aug 22 19:47:57 2007 +0000
@@ -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).