]> git.eshelyaron.com Git - emacs.git/commitdiff
Further fix of hostname completion on MS Windows
authorJim Porter <jporterbugs@gmail.com>
Sat, 10 Apr 2021 11:16:13 +0000 (13:16 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 10 Apr 2021 11:16:13 +0000 (13:16 +0200)
* lisp/net/tramp.el (tramp-completion-file-name-regexp-simplified)
(tramp-completion-file-name-regexp-separate): Fix W32 hostname/method
completion for simplified and separate syntaxes (same as the previous change
to default syntax).

Copyright-paperwork-exempt: yes

lisp/net/tramp.el

index e61c3b1e44c5be542bfb5be6cca96d29b5bfb29d..578fa148a247fd7227ca9eeaba1864ef2d7ca708 100644 (file)
@@ -1103,7 +1103,13 @@ On W32 systems, the volume letter must be ignored.")
 
 (defconst tramp-completion-file-name-regexp-simplified
   (concat
-   "\\`/\\("
+   "\\`"
+   ;; Allow the volume letter at the beginning of the path.  See the
+   ;; comment in `tramp-completion-file-name-regexp-default' for more
+   ;; details.
+   (when (eq system-type 'windows-nt)
+     "\\(?:[[:alpha:]]:\\)?")
+   "/\\("
    ;; Optional multi hop.
    "\\([^/|:]*|\\)*"
    ;; Last hop.
@@ -1119,7 +1125,14 @@ See `tramp-file-name-structure' for more explanations.
 On W32 systems, the volume letter must be ignored.")
 
 (defconst tramp-completion-file-name-regexp-separate
-  "\\`/\\(\\[[^]]*\\)?\\'"
+  (concat
+   "\\`"
+   ;; Allow the volume letter at the beginning of the path.  See the
+   ;; comment in `tramp-completion-file-name-regexp-default' for more
+   ;; details.
+   (when (eq system-type 'windows-nt)
+     "\\(?:[[:alpha:]]:\\)?")
+   "/\\(\\[[^]]*\\)?\\'")
   "Value for `tramp-completion-file-name-regexp' for separate remoting.
 See `tramp-file-name-structure' for more explanations.")