]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix order of tmm-menubar when 'tmm-mid-prompt' is nil
authorEli Zaretskii <eliz@gnu.org>
Mon, 29 May 2023 12:32:51 +0000 (15:32 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 29 May 2023 12:32:51 +0000 (15:32 +0300)
* 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>.

lisp/tmm.el

index 6088961fa4ca6e72fd72971165434b9495b8c26c..88254f0d1b8c5a8a49105be5f7a22cccd87e7519 100644 (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.