From: Jim Porter Date: Fri, 9 Apr 2021 07:57:06 +0000 (+0200) Subject: Fix hostname completion on MS Windows X-Git-Tag: emacs-28.0.90~2962 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1d42f4800bc3759ac961b97b2a66d4b73e520eb5;p=emacs.git 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 --- 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.