unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43756: Fix for TTY menus mouse interaction
@ 2020-10-02  5:56 Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-10-02 14:37 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-02  5:56 UTC (permalink / raw)
  To: 43756


[-- Attachment #1.1: Type: text/plain, Size: 485 bytes --]

Attached is a simple bugfix for tmm.el in Emacs. Currently when the top
level menu is displayed (like when pressing F10), the menu entries are
not in the same order as they are displayed in the menu bar.
Additionally, clicking on any menu entry other than "Help" jumps
straight into the menu clicked on, but clicking on "Help" displays the
root menu. 

Let me know if you need more details to reproduce the issues. In this
case, I think the issues fixed are straightforward. 

  -- MJF

[-- Attachment #1.2: Type: text/html, Size: 692 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fixing-small-bugs-in-tmm.el.patch --]
[-- Type: text/x-diff; name=0001-Fixing-small-bugs-in-tmm.el.patch, Size: 1354 bytes --]

From 836ae1b4e2529cba5af52e270be7dff764abbc9e Mon Sep 17 00:00:00 2001
From: Jared Finder <jared@finder.org>
Date: Thu, 17 Sep 2020 22:37:00 -0700
Subject: [PATCH] Fixing small bugs in tmm.el.

* `tmm-menubar-keymap' now properly sorts final items.
* `tmm-menubar' allows clicks on the final menu item.
---
 lisp/tmm.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/tmm.el b/lisp/tmm.el
index e9f3f5b038..1e18c8b4ae 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -57,7 +57,7 @@ tmm-menubar-keymap
                  menu-end
                menu-bar)))
      (tmm-get-keybind [menu-bar]))
-    `(keymap ,@(nreverse menu-bar) ,@(nreverse menu-end))))
+    `(keymap ,@(nreverse menu-bar) ,@menu-end)))
 
 ;;;###autoload (define-key global-map "\M-`" 'tmm-menubar)
 ;;;###autoload (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
@@ -96,7 +96,10 @@ tmm-menubar
                                          (or (null visible)
                                              (eval visible)))))))
                   (setq column (+ column (length name) 1)))))
-             menu-bar))))
+             menu-bar)
+            ;; Check the last menu item.
+            (when (> column x-position)
+              (setq menu-bar-item prev-key)))))
     (tmm-prompt menu-bar nil menu-bar-item)))
 
 ;;;###autoload
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-10-05 15:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02  5:56 bug#43756: Fix for TTY menus mouse interaction Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-02 14:37 ` Lars Ingebrigtsen
2020-10-02 16:45   ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-02 19:35     ` Eli Zaretskii
2020-10-02 19:54       ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-03  7:23         ` Eli Zaretskii
2020-10-03 17:44           ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-05  8:24             ` Lars Ingebrigtsen
2020-10-05 14:53               ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-05 15:03                 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).