From: Spencer Baugh <sbaugh@janestreet.com>
To: emacs-devel@gnu.org
Subject: Allowing completion sources to customize completion display
Date: Wed, 22 Nov 2023 18:05:04 -0500 [thread overview]
Message-ID: <ierfs0xl78f.fsf@janestreet.com> (raw)
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?
next reply other threads:[~2023-11-22 23:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 23:05 Spencer Baugh [this message]
2023-11-23 8:25 ` Allowing completion sources to customize completion display 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ierfs0xl78f.fsf@janestreet.com \
--to=sbaugh@janestreet.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).