]> git.eshelyaron.com Git - emacs.git/commitdiff
Sort Info index completions alphabetically
authorStefan Kangas <stefankangas@gmail.com>
Wed, 26 Aug 2020 22:50:59 +0000 (00:50 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Wed, 26 Aug 2020 23:11:58 +0000 (01:11 +0200)
* lisp/info.el (Info-complete-menu-item): Sort the list of completions
alphabetically using 'nreverse'.  This makes no difference for Emacs
but helps third-party completion frameworks such as Ivy.  (Bug#38614)

Suggested by Howard Melman <hmelman@gmail.com>.

lisp/info.el

index 8810bc7a83cd32e24743a86555ef3d9726c92b19..fb47cb4d1881974913a268181bc9aa4f2c2d2a63 100644 (file)
@@ -2775,6 +2775,8 @@ Because of ambiguities, this should be concatenated with something like
               ;; Go back to the start node (for the next completion).
               (unless (equal Info-current-node orignode)
                 (Info-goto-node orignode))
+              ;; Sort list alphabetically.
+              (setq completions (nreverse completions))
               ;; Update the cache.
               (setq Info-complete-cache
                   (list Info-current-file Info-current-node