summaryrefslogtreecommitdiff
path: root/lisp/info.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-05-05 13:30:14 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-05 13:30:14 +0200
commitaebff74af27157b60a0d6549be718d85a809b985 (patch)
treed115abb1e243c0967f0b20c7a598ce6b92faba87 /lisp/info.el
parent8364f058b821eba31f84dcded175cca403a965a5 (diff)
downloademacs-aebff74af27157b60a0d6549be718d85a809b985.tar.gz
emacs-aebff74af27157b60a0d6549be718d85a809b985.tar.bz2
emacs-aebff74af27157b60a0d6549be718d85a809b985.zip
Sort completions in Info references/menu correctly
* lisp/info.el (Info-follow-reference): Sort completions in the order they appear in the buffer (bug#54175). (Info-menu-update): Ditto.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 8ca6c549791..abfb77b0552 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2599,7 +2599,8 @@ new buffer."
(if (eq alt-default t) (setq alt-default str))
;; Don't add this string if it's a duplicate.
(or (assoc-string str completions t)
- (push str completions))))
+ (push str completions)))
+ (setq completions (nreverse completions)))
;; If no good default was found, try an alternate.
(or default
(setq default alt-default))
@@ -4285,7 +4286,8 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
(substring str (match-end 0))))
(setq i (1+ i)))
(setq items
- (cons str items))))
+ (cons str items)))
+ (setq items (nreverse items)))
(while (and items (< number 9))
(setq current (car items)
items (cdr items)