Fix order of tmm-menubar when 'tmm-mid-prompt' is nil

* lisp/tmm.el (tmm-prompt): Reverse 'tmm-km-list' when
'tmm-mid-prompt' is nil, to present the menu in the correct order.
Suggested by Thiago Melo <tmdmelo@gmail.com>.
This commit is contained in:
Eli Zaretskii 2023-05-29 15:32:51 +03:00
parent 53dc7bec83
commit d8ba28fa39

View file

@ -170,9 +170,11 @@ instead of executing it."
(error "Empty menu reached"))
(and tmm-km-list
(let ((index-of-default 0))
(if tmm-mid-prompt
(setq tmm-km-list (tmm-add-shortcuts tmm-km-list))
t)
(setq tmm-km-list
(if tmm-mid-prompt
(tmm-add-shortcuts tmm-km-list)
;; tmm-add-shortcuts reverses tmm-km-list internally.
(reverse tmm-km-list)))
;; Find the default item's index within the menu bar.
;; We use this to decide the initial minibuffer contents
;; and initial history position.