]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert commit 225ca617b7, and apply another fix
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 23 Oct 2021 13:21:14 +0000 (15:21 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 23 Oct 2021 13:21:14 +0000 (15:21 +0200)
* 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)

lisp/minibuffer.el
lisp/shell.el

index 13da7f99a389d13a0324f847041bc135a94aabc5..bc21f027b6effe671a94016c1c1da23c4bd6fdea 100644 (file)
@@ -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))
index b575024e016860994ad35e1bcfbb6122c9feadc3..cb4afe6dea8e97e26d3bd5d654d646f32ace5010 100644 (file)
@@ -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)