unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Spencer Baugh <sbaugh@janestreet.com>, Eli Zaretskii <eliz@gnu.org>
Cc: Jim Porter <jporterbugs@gmail.com>,
	"me@eshelyaron.com" <me@eshelyaron.com>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>,
	Dmitry Gutov <dmitry@gutov.dev>, Juri Linkov <juri@linkov.net>
Subject: RE: [External] : Re: Allowing completion sources to customize completion display
Date: Fri, 24 Nov 2023 20:52:46 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488D76CB4DD83E828165F9CF3B8A@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <ier1qcfkqm5.fsf@janestreet.com>

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

FWIW (I'm not following this thread) -

Icicles has option `icicle-hide-non-matching-lines-flag',
which you can toggle anytime during completion with
`C-u C-x .':

  Non-nil means hide candidate lines that do not match input.
  This applies only to multi-line candidates in buffer
  `*Completions*'.  Lines that do not contain text matched
  by your current minibuffer input are elided using ellipsis
  (`...').

Also option `icicle-hide-common-match-in-Completions-flag',
which you can toggle during completion with just `C-x .':

  Non-nil means hide the common match for your input, in
  `*Completions*'.  The common match used here is governed
  by option `icicle-expand-input-to-common-match'.  It is
  elided using ellipsis (`...').

When you hide non-matching lines of completions or their
common-match portions you still see all of the candidates.
It's just that some of their text may be elided.

Hiding common-match text can be especially useful when
that portion of the candidates is large, as it often is
with absolute file names having a common subdirectory.

This is _not_ specific to any particular kind or category
of completion.  It's a question of what a particular user
finds most useful at any given time.  Do _you_ want to
hide some candidate details right _now_, or not?

As usual, my advice for this kind of thing is to give
users control - don't just deciding on a "DWIM" behavior
(which might be fine as a _default_ behavior but should
not be the only one).  Let _users_ decide what "I mean"
means at any given time in any given context.

A user option sets a user's preferred default behavior.
But it's even more important to be able to control the
behavior dynamically, by toggling or cycling among
possible behaviors.

It's good (imperative, really) to give users dynamic
control.  But it can also help to give them (and library
writers) control over the default behavior of a _given
command_.  For hiding the common match among the current
completions this is done by adding/removing property
`icicle-hide-common-match' to/from a command symbol that
uses completion.

For example, by default command `icicle-locate-file' has
(put 'icicle-locate-file 'icicle-hide-common-match t).
But someone who wants that command to show common matches
by default can put this it their init file:
(put 'icicle-locate-file 'icicle-hide-common-match nil)

HTH.



  reply	other threads:[~2023-11-24 20:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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           ` Drew Adams [this message]
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=SJ0PR10MB5488D76CB4DD83E828165F9CF3B8A@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=juri@linkov.net \
    --cc=me@eshelyaron.com \
    --cc=sbaugh@janestreet.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).