diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 21d4607e7cf..a002143108f 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3013,8 +3013,11 @@ completion-file-name-table (substring string 1) pred action)) ((eq (car-safe action) 'boundaries) - (let ((start (length (file-name-directory string))) - (end (string-search "/" (cdr action)))) + (let ((start (length + (if (string-match-p "\\`/[-[:alnum:]]+:[^:]*\\'" string) + string + (file-name-directory string)))) + (end (string-search "/\\:" (cdr action)))) `(boundaries ;; if `string' is "C:" in w32, (file-name-directory string) ;; returns "C:/", so `start' is 3 rather than 2. @@ -4205,6 +4208,9 @@ completion-flex--make-flex-pattern (defun completion-flex-try-completion (string table pred point) "Try to flex-complete STRING in TABLE given PRED and POINT." (unless (and completion-flex-nospace (string-search " " string)) + (if (and (string-match-p "\\`/[-[:alnum:]]+:[^:]*\\'" string) + (eq table 'completion-file-name-table)) + (completion-basic-try-completion string table pred point) (pcase-let ((`(,all ,pattern ,prefix ,suffix ,_carbounds) (completion-substring--all-completions string table pred point @@ -4217,7 +4223,7 @@ completion-flex-try-completion ;; contain the substring "config". FIXME: this still won't ;; augment "foo" to "froo" when matching "frodo" and ;; "farfromsober". - (completion-pcm--merge-try pattern all prefix suffix)))) + (completion-pcm--merge-try pattern all prefix suffix))))) (defun completion-flex-all-completions (string table pred point) "Get flex-completions of STRING in TABLE, given PRED and POINT."