unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Teach completion to insert a common prefix
@ 2023-08-07 20:38 Spencer Baugh
  2023-08-08  6:19 ` Yuri Khan
  0 siblings, 1 reply; 4+ messages in thread
From: Spencer Baugh @ 2023-08-07 20:38 UTC (permalink / raw)
  To: help-gnu-emacs


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?




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-10 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07 20:38 Teach completion to insert a common prefix Spencer Baugh
2023-08-08  6:19 ` Yuri Khan
2023-08-09  4:09   ` Pierre Rouleau
2023-08-10 11:33     ` sbaugh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).