unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Allowing completion sources to customize completion display
@ 2023-11-22 23:05 Spencer Baugh
  2023-11-23  8:25 ` Eshel Yaron
  2023-11-23 14:44 ` Dmitry Gutov
  0 siblings, 2 replies; 19+ messages in thread
From: Spencer Baugh @ 2023-11-22 23:05 UTC (permalink / raw)
  To: emacs-devel


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?




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

end of thread, other threads:[~2023-11-25 20:04 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22 23:05 Allowing completion sources to customize completion display Spencer Baugh
2023-11-23  8:25 ` Eshel Yaron
2023-11-23  8:47   ` Eli Zaretskii
2023-11-23 12:38     ` sbaugh
2023-11-23 13:48       ` Eli Zaretskii
2023-11-23 14:03         ` sbaugh
2023-11-23 14:35           ` Eli Zaretskii
2023-11-23 21:20     ` Jim Porter
2023-11-24  7:15       ` Eli Zaretskii
2023-11-24 17:28         ` Spencer Baugh
2023-11-24 20:52           ` [External] : " Drew Adams
2023-11-25  0:25           ` Dmitry Gutov
2023-11-25 17:36             ` sbaugh
2023-11-25 18:27               ` Dmitry Gutov
2023-11-25 19:07                 ` Eli Zaretskii
2023-11-25 19:08                   ` Dmitry Gutov
2023-11-25 20:04                     ` Eli Zaretskii
2023-11-25  6:59           ` Eli Zaretskii
2023-11-23 14:44 ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).