diff options
author | Jim Porter <jporterbugs@gmail.com> | 2021-04-09 09:57:06 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2021-04-09 09:57:06 +0200 |
commit | 1d42f4800bc3759ac961b97b2a66d4b73e520eb5 (patch) | |
tree | 079b3b13c1cce44219dfc7cc81ac27f2cce26422 | |
parent | dfdec267aece1e3b4da378d347b6d18d52366060 (diff) | |
download | emacs-1d42f4800bc3759ac961b97b2a66d4b73e520eb5.tar.gz |
Fix hostname completion on MS Windows
* lisp/net/tramp.el (tramp-completion-file-name-regexp-default):
Handle volume letter being added to paths for file name completion on W32
systems. This fixes hostname (and method) autocomplete on W32.
Copyright-paperwork-exempt: yes
-rw-r--r-- | lisp/net/tramp.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b2c650f6e1a..e61c3b1e44c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1078,7 +1078,13 @@ initial value is overwritten by the car of `tramp-file-name-structure'.") (defconst tramp-completion-file-name-regexp-default (concat - "\\`/\\(" + "\\`" + ;; `file-name-completion' uses absolute paths for matching. This + ;; means that on W32 systems, something like "/ssh:host:~/path" + ;; becomes "c:/ssh:host:~/path". See also `tramp-drop-volume-letter'. + (when (eq system-type 'windows-nt) + "\\(?:[[:alpha:]]:\\)?") + "/\\(" ;; Optional multi hop. "\\([^/|:]+:[^/|:]*|\\)*" ;; Last hop. |