GNU bug report logs - #38614
26.3; Info completions in reverse order

Previous Next

Package: emacs;

Reported by: Howard Melman <hmelman <at> gmail.com>

Date: Sat, 14 Dec 2019 21:17:02 UTC

Severity: normal

Found in version 26.3

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 38614 <at> debbugs.gnu.org (full text, mbox):

From: Howard Melman <hmelman <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38614 <at> debbugs.gnu.org
Subject: Re: bug#38614: 26.3;  Info completions in reverse order
Date: Fri, 3 Jan 2020 14:27:03 -0500
I wrote on Sat, 14 Dec 2019:

> When using ivy mode, Info-index shows me the list of
> completions in reverse alphabetical order. Info-menu does too.
> Both Info-index and Info-menu use completing-read with
> Info-complete-menu-item as the collections argument. It
> seems to generate the list in reverse order.
> 
> Sorry this isn't a formatted patch, but a one line fix solves it for me.
> 
> If after this line in Info-complete-menu-item:
> 		    (setq completions (delete-dups completions))
> I add this line:
> 		    (setq completions (nreverse completions))
> the index and menus are shown in alphabetical order.


My original fix was in the wrong place. It only worked for info files that had a single index node (e.g., elisp.info). To work more generally with files with several index nodes (e.g., emacs.info) the new line should be just before the cache is updated:

              (setq completions (nreverse completions))  ; added fix
              ;; Update the cache.
              (setq Info-complete-cache
		    (list Info-current-file Info-current-node
			  Info-complete-next-re string completions
			  Info-complete-nodes)))
		
I still hope this is considered. The cost of the nreverse here is small, and if completion mechanisms sort the list later, they'll find an already sorted list will sort faster than the degenerate case of sorting a list already in reverse order.

Howard



This bug report was last modified 4 years and 272 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.