emacs-devel
[Top][All Lists]
Advanced

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

Allowing completion sources to customize completion display


From: Spencer Baugh
Subject: Allowing completion sources to customize completion display
Date: Wed, 22 Nov 2023 18:05:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

If I have multiple sources for completion active at once, I might prefer
different completion sources to be displayed differently.

For example, if a completion source returns individual symbols,
displaying the symbols in the *Completions* buffer seems good.
So the default completion-in-region-function is good.

But if a completion source returns multi-line blocks of text, I might
want to see those blocks of text displayed in context in the buffer,
rather than in a separate buffer.  Perhaps I'd see only the first
completion candidate displayed in-buffer, and have some key bindings
which let me cycle between them.  The exact details of the UI aren't
important, just that it's different from what I want for symbol
completion.  So I'd set completion-in-region-function to something
different.

I have completion-at-point-functions='(symbol-completion
block-completion), so if symbol-completion returns nil then I get
block-completion instead - exactly what I want.

But the same completion-in-region-function and UI has to be used
regardless of whether I'm getting symbol-completion or block-completion
- I don't see a way to change completion-in-region-function based on the
source.

Maybe we should add one?

Some possibilities:
- Maybe completion table metadata could just include a
  completion-in-region-function to use?

- Maybe completion-category-overrides could change
  completion-in-region-function based on the category?

- Maybe something else entirely?




reply via email to

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