[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allowing completion sources to customize completion display
|
From: |
Eli Zaretskii |
|
Subject: |
Re: Allowing completion sources to customize completion display |
|
Date: |
Sat, 25 Nov 2023 08:59:00 +0200 |
> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: Jim Porter <jporterbugs@gmail.com>, me@eshelyaron.com,
> emacs-devel@gnu.org, Dmitry Gutov <dmitry@gutov.dev>, Juri Linkov
> <juri@linkov.net>
> Date: Fri, 24 Nov 2023 12:28:34 -0500
>
> In my example, I was considering two sources, one which returns symbols
> and one which usually returns big multi-line strings. And I, as a user,
> wanted the default Completions buffer for the first, and inline preview
> for the second.
>
> But basing this on the source is totally wrong. Instead if I, as a
> user, think inline preview is better for multi-line completion
> candidates, then inline preview should be used for multi-line completion
> candidates regardless of where those candidates come from.
>
> So I, as a user, can just configure my completion UI to detect
> multi-line completion candidates and alter the UI in that case. No need
> to care about the sources of completion candidates.
>
> And such configuration options would be straightforward to add to any
> completion UI, including the default completion-in-region-function.
I'm not sure I understand what you mean by "multi-line completion
candidates", but if I do, IMO we should display each supported format
of completion candidates in a way that fits that format. IOW, there's
no reason to ask the user to configure that; we should instead provide
OOTB built-in UI for displaying candidates based on their "type".
> Now just separately speculating about what concrete options might be
> nice to add at some point to the default completion UI, to get nice
> inline preview behavior for multi-line strings...
>
> Perhaps two options:
>
> - completions-ghost-preview=t shows, in the buffer or minibuffer, a
> grayed-out "ghost" preview of the currently selected completion
> candidate.
>
> - completions-multi-line-suppress=t makes the *Completions* buffer
> shrink down to just show completion-header-format and
> completion-show-help whenever there's multi-line candidates among the
> completions. (So you'd only have the preview from
> completions-ghost-preview.)
If this is about preview of candidates specifically, using the
*Completions* buffer doesn't sound like a good idea to me, since
popping a buffer up and down and resizing its window as the user types
produces annoying visual effects, and also will slow down the preview,
since these operations are relatively expensive.
How about showing a multiline "ghost" instead? Or maybe you should
produce a few examples of such multiline candidates, so that this
discussion is less academic?
- Re: Allowing completion sources to customize completion display, (continued)
- Re: Allowing completion sources to customize completion display, Jim Porter, 2023/11/23
- Re: Allowing completion sources to customize completion display, Eli Zaretskii, 2023/11/24
- Re: Allowing completion sources to customize completion display, Spencer Baugh, 2023/11/24
- RE: [External] : Re: Allowing completion sources to customize completion display, Drew Adams, 2023/11/24
- Re: Allowing completion sources to customize completion display, Dmitry Gutov, 2023/11/24
- Re: Allowing completion sources to customize completion display, sbaugh, 2023/11/25
- Re: Allowing completion sources to customize completion display, Dmitry Gutov, 2023/11/25
- Re: Allowing completion sources to customize completion display, Eli Zaretskii, 2023/11/25
- Re: Allowing completion sources to customize completion display, Dmitry Gutov, 2023/11/25
- Re: Allowing completion sources to customize completion display, Eli Zaretskii, 2023/11/25
- Re: Allowing completion sources to customize completion display,
Eli Zaretskii <=
Re: Allowing completion sources to customize completion display, Dmitry Gutov, 2023/11/23