all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: emacs-devel@gnu.org
Subject: Re: Navigating completions from minibuffer
Date: Wed, 15 Nov 2023 16:40:35 -0500	[thread overview]
Message-ID: <ierr0kqk84s.fsf@janestreet.com> (raw)
In-Reply-To: 864jhokelp.fsf@mail.linkov.net

Juri Linkov <juri@linkov.net> writes:
>>>> Probably we have to make RET more smart, so that when more editing
>>>> was performed in the minibuffer after the completions were displayed,
>>>> then to use the minibuffer contents with exit-minibuffer,
>>>> not an obsolete completion candidate that remains selected.
>>>
>>> Interesting solution!  So if the last relevant command was changing the
>>> selected candidate, then RET submits the candidate; if the last relevant
>>> command was editing the minibuffer, then RET submits the minibuffer
>>> text.
>>>
>>> What about the case where I type some text, switch between some
>>> completion candidates in *Completions*, then decide I don't want any of
>>> them and hit RET to submit the minibuffer text?  That's something that
>>> works today.  Can we support that somehow?
>>
>> Currently the suggested way to avoid selecting a highlighted candidate
>> is to close the completions window with C-g, i.e. it adheres
>> to the principle “what you see is what you get” - when you see
>> a highlighted candidate then you will get it, otherwise you will get
>> the minibuffer contents.
>
> So there are at least 2 variants what to do when completing-read is used
> as selection rather than completion:
>
> 1. On editing the minibuffer close the completions window as expired.
>
> Shouldn't 'completion-auto-help' support this case?
> Should it have a new value 'close'?
> Or need to create a new option 'completion-auto-close'?

I think a new option would be better, the different options for
completion-auto-help all seem plausible to combine with that behavior.

It's a bit tricky since completion-auto-update=t effectively implies
completion-auto-close=t.

Oh, actually, perhaps completion-auto-close should be merged with
completion-auto-update.  Then completion-auto-update has three values:

- nil (today's behavior)
- close (close the completions window on editing the minibufer)
- t (auto-update the completions window on editing the minibuffer)

After all, both non-nil values would use basically the same
implementation.

> 2. AFAIR, 'completion-auto-update' already closes the completions window
> if none of completion candidates matches the contents of the minibuffer?
>
> So editing the minibuffer never causes a situation where a highlighted
> candidate doesn't match the minibuffer contents?
>
> And typing some characters to narrow down the completions
> always keeps the highlighted candidate selected?
>
> Then there is no problem.

Yes, that's correct.

Very interesting analysis!  This makes sense.




  reply	other threads:[~2023-11-15 21:40 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07  3:57 Navigating completions from minibuffer T.V Raman
2023-11-07  4:55 ` T.V Raman
2023-11-07  7:20   ` Juri Linkov
2023-11-07 17:53     ` T.V Raman
2023-11-07 19:36       ` T.V Raman
2023-11-08  7:39         ` Juri Linkov
2023-11-08 16:21           ` T.V Raman
2023-11-08 17:18             ` T.V Raman
2023-11-08 22:11               ` Slow completion-at-point was " T.V Raman
2023-11-09  7:22                 ` Slow completion-at-point Juri Linkov
2023-11-09 12:10                   ` Dmitry Gutov
2023-11-09 16:20                     ` Juri Linkov
2023-11-09 18:32                       ` João Távora
2023-11-11  2:48                     ` T.V Raman
2023-11-11 10:36                       ` Dmitry Gutov
2023-11-11 16:40                         ` T.V Raman
2023-11-11 19:00                           ` Juri Linkov
2023-11-11 19:43                             ` T.V Raman
2023-11-11 21:50                               ` Dmitry Gutov
2023-11-09 15:39                   ` T.V Raman
2023-11-09 12:20                 ` Slow completion-at-point was Re: Navigating completions from minibuffer Dmitry Gutov
2023-11-09 15:41                   ` T.V Raman
2023-11-09 17:46                 ` T.V Raman
2023-11-10 13:12           ` Spencer Baugh
2023-11-11 18:58             ` Juri Linkov
2023-11-14  7:36               ` Juri Linkov
2023-11-15 21:40                 ` Spencer Baugh [this message]
2023-11-16 17:15                   ` T.V Raman
2023-11-15 22:03                 ` Spencer Baugh
2023-11-16  7:16                   ` Juri Linkov
2023-11-16 14:41                     ` Spencer Baugh
2023-11-16 17:28                       ` Juri Linkov
2023-11-16 18:25                         ` Spencer Baugh
2023-11-17  7:09                           ` Juri Linkov
2023-11-17 17:22                             ` Spencer Baugh
2023-11-18 20:58                               ` sbaugh
2023-11-19  7:08                                 ` Juri Linkov
2023-11-19  8:19                                   ` Eli Zaretskii
2023-11-19 14:41                                   ` Spencer Baugh
2023-11-19 18:01                                     ` Juri Linkov
2023-11-19 19:41                                       ` Spencer Baugh
2023-11-20  2:58                                       ` Spencer Baugh
2023-11-23 13:39                                     ` sbaugh
2023-11-24  7:54                                       ` Juri Linkov
2023-11-25 15:19                                         ` Spencer Baugh
2023-11-25 16:08                                           ` Eli Zaretskii
2023-11-25 18:23                                             ` sbaugh
2023-11-25 18:48                                               ` Juri Linkov
2023-11-26 13:10                                                 ` sbaugh
2023-11-25 19:00                                               ` Eli Zaretskii
2023-11-25 17:46                                           ` Juri Linkov
2023-11-26 14:33                                             ` Spencer Baugh
2023-11-27  7:22                                               ` Juri Linkov
2023-11-28 14:48                                                 ` Spencer Baugh
2023-11-28 17:23                                                   ` Juri Linkov
2023-11-29  0:20                                                     ` Spencer Baugh
2023-12-03 17:21                                                       ` Juri Linkov
2023-12-03 18:13                                                         ` Eli Zaretskii
2023-12-06 17:20                                                           ` Juri Linkov
2023-12-06 17:50                                                             ` Eli Zaretskii
2023-12-07  7:44                                                               ` Juri Linkov
2023-12-08  8:46                                                                 ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ierr0kqk84s.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.