unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gregory Heytings <gregory@heytings.org>
Cc: kahatlen@gmail.com, 60411@debbugs.gnu.org,
	monnier@iro.umontreal.ca, juri@linkov.net
Subject: bug#60411: 29.0.60; minibuffer-next-completion skips first candidate when completions-header-format and completion-show-help are nil
Date: Fri, 06 Jan 2023 13:40:16 +0200	[thread overview]
Message-ID: <83tu13vqlb.fsf@gnu.org> (raw)
In-Reply-To: <371ba1d0be87d64ed419@heytings.org> (message from Gregory Heytings on Fri, 06 Jan 2023 09:01:08 +0000)

> Date: Fri, 06 Jan 2023 09:01:08 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: kahatlen@gmail.com, 60411@debbugs.gnu.org, monnier@iro.umontreal.ca, 
>     juri@linkov.net
> 
> 
> >>>> Stefan and Eli, do you agree with that conclusion?
> >>>
> >>> I admit that I've lost the line of reasoning here (too much of the 
> >>> previous context is being elided, forcing me to re-read the entire 
> >>> discussion).  Which code is proposed for the release branch, and how 
> >>> will Emacs behave with that code in this particular use case?
> >>
> >> It's this patch.  It adds an invisible empty line at the beginning of 
> >> *Completions* when completions-header-format is not a string (in 
> >> particular, nil) or an empty string.
> >
> > What is the significance of these two special values of 
> > completions-header-format?  Is it that you want to test whether the 
> > first candidates starts at buffer position 1 in the *Completions* 
> > buffer?  Then why not test for that explicitly?
> >
> 
> When completions-header-format is nil or an empty string, no completion 
> header "NNN possible completions:\n" is inserted in *Completions*. 
> Because of this, minibuffer-next-completion (bound to M-<down> by 
> default), which is supposed to select the first completion when it is 
> called for the first time, erroneously selects the second completion. 
> The fact that "something" (the completion header and/or the help text 
> "Click on a completion to select it...") must exist in *Completions* 
> before the first completion candidate is more or less hardcoded in the 
> logic of minibuffer-next-completion.

Then why not change that logic in minibuffer-next-completion to be
smarter about this?

What you suggest is too ad-hoc-ish, and any future change to the
possible values of completions-header-format will risk breaking the
condition you propose.

Or maybe what minibuffer-next-completion does should be rethought?
Why does it assume that the first candidate is on the second line?
what if it's on the third line instead?





  reply	other threads:[~2023-01-06 11:40 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29 21:25 bug#60411: 29.0.60; minibuffer-next-completion skips first candidate when completions-header-format and completion-show-help are nil Knut Anders Hatlen
2022-12-30  8:11 ` Eli Zaretskii
2022-12-30 11:04   ` Knut Anders Hatlen
2022-12-30 21:54 ` Gregory Heytings
2022-12-31  6:27   ` Knut Anders Hatlen
2022-12-31 15:02     ` Gregory Heytings
2022-12-31 15:33       ` Knut Anders Hatlen
2022-12-31 15:35         ` Gregory Heytings
2022-12-31 16:40       ` Eli Zaretskii
2023-01-01 17:00       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 17:05         ` Gregory Heytings
2023-01-01 17:55           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 18:56             ` Gregory Heytings
2023-01-05 17:37               ` Juri Linkov
2023-01-05 21:04                 ` Gregory Heytings
2023-01-06  6:43                   ` Eli Zaretskii
2023-01-06  8:22                     ` Gregory Heytings
2023-01-06  8:52                       ` Eli Zaretskii
2023-01-06  9:01                         ` Gregory Heytings
2023-01-06 11:40                           ` Eli Zaretskii [this message]
2023-01-06 12:13                             ` Gregory Heytings
2023-01-06 12:21                               ` Eli Zaretskii
2023-01-06 12:39                                 ` Gregory Heytings
2023-01-06 12:59                                   ` Eli Zaretskii
2023-01-06 13:10                                     ` Gregory Heytings
2023-01-06 13:26                                       ` Eli Zaretskii
2023-01-06 17:07                                         ` Gregory Heytings
2023-01-06 18:05                                           ` Eli Zaretskii
2023-01-06 18:23                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-06 18:51                                               ` Gregory Heytings
2023-01-07 18:11                                           ` Juri Linkov
2023-01-07 18:15                                             ` Juri Linkov
2023-01-07 22:35                                               ` Gregory Heytings
2023-01-08  8:42                                                 ` Juri Linkov
2023-01-08 22:43                                                   ` Gregory Heytings
2023-01-12 17:48                                                 ` Juri Linkov
2023-01-06 17:51                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-06 18:11                                   ` Eli Zaretskii
2023-01-06 18:49                                   ` Gregory Heytings

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=83tu13vqlb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=60411@debbugs.gnu.org \
    --cc=gregory@heytings.org \
    --cc=juri@linkov.net \
    --cc=kahatlen@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).