From: Michael Albinus Date: Sat, 23 Oct 2021 13:21:14 +0000 (+0200) Subject: Revert commit 225ca617b7, and apply another fix X-Git-Tag: emacs-28.0.90~202 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c5fbd712b;p=emacs.git Revert commit 225ca617b7, and apply another fix * lisp/minibuffer.el (read-file-name-default): Revert commit 225ca617b7. (Bug#50976). * lisp/shell.el (shell): Remove volume letter for remote shell file name. (Bug#49229) --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 13da7f99a38..bc21f027b6e 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3214,7 +3214,6 @@ See `read-file-name' for the meaning of the arguments." (unless val (error "No file name specified")) (if (and default-filename - (not (file-remote-p dir)) (string-equal val (if (consp insdef) (car insdef) insdef))) (setq val default-filename)) (setq val (substitute-in-file-name val)) diff --git a/lisp/shell.el b/lisp/shell.el index b575024e016..cb4afe6dea8 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -766,12 +766,16 @@ Make the shell buffer the current buffer, and return it. (called-interactively-p 'any) (null explicit-shell-file-name) (null (getenv "ESHELL"))) + ;; `expand-file-name' shall not add the MS Windows volume letter + ;; (Bug#49229). (setq-local explicit-shell-file-name - (file-local-name - (expand-file-name - (read-file-name "Remote shell path: " default-directory - shell-file-name t shell-file-name - #'file-remote-p))))) + (replace-regexp-in-string + "^[[:alpha:]]:" "" + (file-local-name + (expand-file-name + (read-file-name "Remote shell path: " default-directory + shell-file-name t shell-file-name + #'file-remote-p)))))) ;; Rain or shine, BUFFER must be current by now. (unless (comint-check-proc buffer)