unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Howard Melman <hmelman@gmail.com>
To: 54175@debbugs.gnu.org
Subject: bug#54175: 27.2; Info-follow-reference completions in reverse order
Date: Wed, 04 May 2022 10:46:58 -0400	[thread overview]
Message-ID: <ly7d71nyn1.fsf@new-host-4.home> (raw)
In-Reply-To: <7A89A71F-708C-4217-989C-2E9990759E13@gmail.com>


To follow up on this from Feb.  Here's a summary of
what's been discussed.  My original report:

> This is the same issue as in bug#38614 which was about
> Info-complete-menu-item, but this is about
> Info-follow-reference.  I hope it will also be fixed.
>
> Info-follow-reference calls completing-read with a list of
> candidates found in the node.  It scans the node from top to
> bottom pushing references onto a completions list.  The list
> ends up being in the reverse order of position in the node.
> For the default completion mechanism this isn't a problem,
> but with a completion package like fido or ivy which
> immediately displays the list of candidates, this order
> isn't particularly useful.
>
> My use case is browsing an info manual, going to a new node
> via n, so my point is near the top of the node.  I see I
> want to follow the first reference and type f and I'm
> presented with a list of completion candidates. The first
> candidate is from the bottom of the node, it's not even
> visible on my screen.  If the list was in the order as found
> in the mode I could just type RET, but now I have to type to
> complete or beforehand position point at the reference so
> that it will be used as a default.
>
> I suggest adding something like the following in
> Info-follow-reference just after the while loop that builds
> completions:
>
>      (setq completions (nreverse completions))
>

Eli argued that this would put a burden on users who stick
with the default completion system.  I showed that his example
degenerate case had no meaningful performance impact.

He also asked why is this order more meaningful.  It seems
obvious to me that the order the references appear in the
text is more meaningful than the reverse of that order.  And I
showed a common use case of visiting a page and wanting
to follow one of the first references without having to move point,
particularly if the node fits on one page.

Eli proposed some different order could be more useful.  I said "I
proposed an easy-to-understand one line fix with negligible
performance impact similar to a previously accepted fix; if someone
wants to fix it with a rewrite of the function I don't object."
Additionally, I point out that this change doesn't affect that if
point is on a reference the default is still that reference.

I also pointed out:

> There is code in Info-menu-update "stolen from
> `Info-follow-reference'" that builds the dynamic submenu of
> References.  That currently shows references, in the menu in the
> same reverse order.  It would be nice if those were in some sensible
> order; either alphabetical or as found in the node seem more
> reasonable than what's there now.

I think the order of a menu is more clearly a bug than of a
completion table, but I think both should be fixed. My
preference would be that the order in a menu be the order of
references found in the text and that Info-follow-reference
candidates use the same order.  I think alphabetical is also
reasonable for this menu and could be different from
Info-follow-reference, but I don't see how it's useful for
either to be in the reverse order as found in the text.

I still think the proposed one line fix (applied in both
places) is the easiest and least risky change.

-- 

Howard






  reply	other threads:[~2022-05-04 14:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27  0:17 bug#54175: 27.2; Info-follow-reference completions in reverse order Howard Melman
2022-02-27  7:17 ` Eli Zaretskii
2022-02-27 15:43   ` Howard Melman
2022-02-27 16:36     ` Eli Zaretskii
2022-02-27 16:52       ` Howard Melman
2022-02-27 16:49     ` Eli Zaretskii
2022-02-27 16:59       ` Howard Melman
2022-02-27 17:09         ` Eli Zaretskii
2022-02-27 17:18           ` Howard Melman
2022-02-27 17:31             ` Eli Zaretskii
2022-02-27 17:50               ` Howard Melman
2022-05-04 14:46                 ` Howard Melman [this message]
2022-05-05 11:30                   ` Lars Ingebrigtsen
2022-05-05 14:00                     ` Howard Melman

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=ly7d71nyn1.fsf@new-host-4.home \
    --to=hmelman@gmail.com \
    --cc=54175@debbugs.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 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).