all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Howard Melman <hmelman@gmail.com>
Cc: 38614@debbugs.gnu.org
Subject: bug#38614: 26.3; Info completions in reverse order
Date: Wed, 26 Aug 2020 16:20:38 -0700	[thread overview]
Message-ID: <CADwFkmnrhQ7Bw4g=STBLxnyBTMEtpr+Mc9eEsrr28vWvwCRm+w@mail.gmail.com> (raw)
In-Reply-To: <57154DCC-52F1-4B7A-BDB8-A3586E365C29@gmail.com>

close 38614 28.1
thanks

Howard Melman <hmelman@gmail.com> writes:

> While I don't particularly know ido code and only know a little of
> ivy, I think understand what's happening here.  Both ivy and standard
> emacs facilities use the list of candidates passed to completing-read,
> in this case that's code that's part of info-mode and not an ivy
> function or an ido function.
>
> Ivy will show a list of candidates immediately, before you type any
> input, and once you start typing input, will narrow and sort that list
> of candidates (using some criteria).  ido (or whatever emacs' default
> is) AFAIU doesn't show candidates before you hit TAB and once you do,
> it shows a sorted list of matching candidates.
>
> The bug here, is that the initial list, generated by info-mode code,
> the one ivy shows and ido doesn't, returns the candidates in list in
> the reverse order it found them in the buffer (unlike other places
> that generate candidate lists).  I agree, there's no requirement about
> the order of the initial candidates list, but it would be reasonable
> for the list, in this case, generated from an info page, to be in the
> order they appear in the page, and while base emacs doesn't make use
> of that order, ivy would (and possibly helm, I'm not sure).
>
> AFAIK users of the standard emacs facilities will see no functional
> change by this.  There's just the cost of the nreverse, which given
> the number of menu entries in an info page should be negligible and in
> some cases, like info indexes that are in alphabetical order
> initially, this should be faster, because for a list already in
> reverse alphabetical order, nreverse and sort could be faster than
> just sort.

Thanks for the explanation.  I think your reasoning here makes sense.

I made the change and tested the default, ido-mode, fido-mode and
icomplete.  I did not observe any regressions in terms of performance or
sort order for any of them.

In addition, I have also been bothered by this issue in the past using
Ivy, and can confirm that the proposed fix solves the issue.

So I have now made that change on the master branch (commit 5a1785d58a).
If anyone notices any adverse effects from this change, feel free to
revert it.

I'm closing this bug report with this message.

Best regards,
Stefan Kangas





  reply	other threads:[~2020-08-26 23:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 17:18 bug#38614: 26.3; Info completions in reverse order Howard Melman
2019-12-15 16:06 ` Eli Zaretskii
2019-12-15 19:39   ` Howard Melman
2020-01-03 19:27     ` Howard Melman
2020-08-25 23:09     ` Stefan Kangas
2020-08-25 23:38       ` Howard Melman
2020-08-26 23:20         ` Stefan Kangas [this message]
2020-08-26 23:39           ` Howard Melman
2020-08-27  0:04             ` Stefan Kangas
2020-08-27  0:05               ` Howard Melman
2020-08-27  0:45                 ` Stefan Kangas

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='CADwFkmnrhQ7Bw4g=STBLxnyBTMEtpr+Mc9eEsrr28vWvwCRm+w@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=38614@debbugs.gnu.org \
    --cc=hmelman@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 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.