bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stefan Monnier
Subject: bug#70217: [PATCH] Add substring-partial-completion style
Date: Fri, 05 Apr 2024 14:35:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

> It's preferable for this to be a separate style from partial-completion
> rather than a customization for partial-completion, because completing
> with a leading glob is inefficient: it doesn't allow the completion
> table to do any filtering at all.  So, for example, one might want the
> regular partial-completion style to run first, and if it doesn't find
> anything then the substring-partial-completion style can run.

FWIW, I think the "language of completion styles" would benefit from
being a bit richer.  I.e. instead of a completion style (i.e. an entry
in `completion-styles`) being limited to a symbol, we could
extend it so a style can take arguments.

E.g. the `substring` style could take an argument which when set to the
symbol `pcm` would cause it to behave like your "substring-partial-completion":

    (setq completion-styles '(basic (substring pcm) emacs22))

Alternatively, it could be an argument to `partial-completion`, e.g.:

    (setq completion-styles '(basic (partial-completion notanchored) emacs22))


- Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]