Subject: bug#70217: [PATCH] Add substring-partial-completion style

From: Michael Albinus <[email-masked]>
Date: Sun, 26 May 2024 09:56:20 +0200

Spencer Baugh <[email-masked]> writes:

Hi Spencer,

> --- a/lisp/minibuffer.el
> +++ b/lisp/minibuffer.el
> @@ -1141,10 +1141,22 @@ completion-styles
>      ;; and simply add "bar" to the end of the result.
>      emacs22)
>    "List of completion styles to use.
> -The available styles are listed in `completion-styles-alist'.
> +An element should be a symbol which is listed in
> +`completion-styles-alist'.
> +
> +An element can also be a list of the form \"(style ((variable value)
> +...))\".  \"style\" must be a symbol listed in
> +`completion-styles-alist', followed by a `let'-style list of
> +variable/value pairs.  \"variable\" will be bound to \"value\" (without
> +evaluating it) while the style is handling completion.  This allows
> +repeating the same style with different configurations.
>
>  Note that `completion-category-overrides' may override these
> -styles for specific categories, such as files, buffers, etc."
> +styles for specific categories, such as files, buffers, etc.
> +
> +Note that Tramp host name completion (e.g., \"/ssh:ho<TAB>\")
> +currently doesn't work if this list doesn't contain at least one
> +of `basic', `emacs22' or `emacs21'."

Are you sure? I thought this general problem was fixed in Tramp 2.6.1
(Emacs 29.2). What's left are problems of Tramp with the `initials' and
`shorthand' completion styles. See
`tramp-test26-interactive-file-name-completion':

--8<---------------cut here---------------start------------->8---
          (dolist
              (style
               (if (tramp--test-expensive-test-p)
                   ;; It doesn't work for `initials' and `shorthand'
                   ;; completion styles.  Should it?
		   ;; `orderless' passes the tests, but it is an ELPA package.
                   '(emacs21 emacs22 basic partial-completion substring flex)
		 '(basic)))
            ...
--8<---------------cut here---------------end--------------->8---

Shall I extend the test for `substring-partial-completion'?

Best regards, Michael.