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

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

Teach completion to insert a common prefix


From: Spencer Baugh
Subject: Teach completion to insert a common prefix
Date: Mon, 07 Aug 2023 16:38:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

Example in emacs -Q:

C-h v -matching-lines- TAB

All possible completions for -matching-lines- start with
list-matching-lines-.  So there would be no harm in inserting "list" at
the start of the completion input.  But Emacs does not do this.

Is it possible to teach Emacs completion to insert a common prefix if
there is one, like in this situation?

Two reasons:

- It would look nicer

- It would make completion work better if the desired completion
alternative is itself a prefix of some other alternative.  For example,
if both list-matching-lines-buffer and list-matching-lines-buffer-face
are available completion alternatives, then it is hard to use completion
to input list-matching-lines-buffer, since it only completes to
-matching-lines-buffer which is not an actual alternative.

This is *not* a matter of completion-styles, variable completion already
uses the substring completion style, otherwise -matching-lines- wouldn't
even validly complete to list-matching-lines-something.

This is purely a matter of teaching completion to eagerly insert the
common prefix when there is one.

Is this possible?




reply via email to

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