From: Eli Zaretskii <eliz@gnu.org>
To: Eshel Yaron <me@eshelyaron.com>
Cc: philipk@posteo.net, juri@linkov.net, dmitry@gutov.dev,
joaotavora@gmail.com, 66948@debbugs.gnu.org,
stefankangas@gmail.com
Subject: bug#66948: [PATCH] Add Completion Preview mode
Date: Wed, 15 Nov 2023 15:27:34 +0200 [thread overview]
Message-ID: <83wmujqh89.fsf@gnu.org> (raw)
In-Reply-To: <m1a5rkzeg8.fsf@dazzs-mbp.home> (message from Eshel Yaron on Sat, 11 Nov 2023 13:01:27 +0100)
> From: Eshel Yaron <me@eshelyaron.com>
> Cc: philipk@posteo.net, juri@linkov.net, dmitry@gutov.dev,
> stefankangas@gmail.com, 66948@debbugs.gnu.org, joaotavora@gmail.com
> Date: Sat, 11 Nov 2023 13:01:27 +0100
>
> >> Basically, a single character often has many completion candidates, and
> >> most of them are not what you want. After three characters, the preview
> >> is much more likely to show you a useful candidate. So you can think of
> >> this option as an adjustable threshold for how much information we
> >> require the completion backend to have before we consider its
> >> suggestions any good. I'm open to changing the default value, but I
> >> think that three characters is a very sane default.
> >
> > The advantage of 1 character is that we don't need this defcustom at
> > all, and it is basically up to the user when to type TAB, or even look
> > at the preview.
>
> One character is not the same as removing this `defcustom`. Without
> this `defcustom`, i.e. without checking the length of the symbol at
> point, we would try to show the preview even after the user types a
> bunch of space and there is nothing useful to complete at point at all.
>
> > Alternatively, we could have a defcustom based on a different design:
> > show preview only when there are fewer than N completion candidates,
> > with N being customizable. That would make much more sense, IMO,
> > since it replaces a largely "mechanical" limitation with one that is
> > meaningful for users.
>
> That would indeed be a nice solution, but it has a fatal flaw, sadly.
> Computing the set of completion candidates is a costly operation,
> especially with backends such as LSP, so we don't want to do that after
> each command.
This seems to be an argument in favor of the timer-based design I
suggested. But if you aren't inclined to do that, I guess we can
install the feature as it is designed now.
> >> > The underline face is not universally supported, so this defface
> >> > should have fallbacks.
> >>
> >> The `underline` face in faces.el has `:underline t` in the fallback
> >> clause too, so I figured that should be alright, no?
> >
> > If you are okay with seeing no effect at all when the terminal doesn't
> > support the underline attribute, then yes. But I thought we want this
> > face to stand out no matter what, don't we?
>
> That's okay IMO, the underline just differentiates between when you have
> a single candidate and when you have multiple candidates. I don't think
> that's that crucial, but if you can suggest a universally supported
> fallback I'd be glad to add it, of course.
How about some color (foreground or background)?
next prev parent reply other threads:[~2023-11-15 13:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-05 10:26 bug#66948: [PATCH] Add Completion Preview mode Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-05 18:26 ` Philip Kaludercic
2023-11-05 19:42 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-06 7:22 ` Juri Linkov
2023-11-06 15:30 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-06 18:05 ` Juri Linkov
2023-11-06 19:47 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-07 7:08 ` Juri Linkov
2023-11-08 7:30 ` Juri Linkov
2023-11-08 9:14 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-08 15:44 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-09 7:25 ` Juri Linkov
2023-11-10 7:09 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-10 7:43 ` Eli Zaretskii
2023-11-10 7:58 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-10 7:59 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-10 13:05 ` Eli Zaretskii
2023-11-10 16:23 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-11 8:53 ` Eli Zaretskii
2023-11-11 12:01 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 13:27 ` Eli Zaretskii [this message]
2023-11-15 14:22 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 17:17 ` Eli Zaretskii
2023-11-15 19:02 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-10 8:00 ` Philip Kaludercic
2023-11-06 7:36 ` Philip Kaludercic
2023-11-06 15:37 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 10:28 ` Sean Whitton
2023-11-15 10:57 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=83wmujqh89.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=66948@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=joaotavora@gmail.com \
--cc=juri@linkov.net \
--cc=me@eshelyaron.com \
--cc=philipk@posteo.net \
--cc=stefankangas@gmail.com \
/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).