emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making TTY menus more visual


From: Jared Finder
Subject: Re: Making TTY menus more visual
Date: Fri, 09 Oct 2020 22:20:36 -0700
User-agent: Roundcube Webmail/1.3.15

On 2020-10-09 8:02 am, Eli Zaretskii wrote:
Date: Thu, 08 Oct 2020 22:17:41 -0700
From: Jared Finder <jared@finder.org>
Cc: emacs-devel@gnu.org

I've also added one additional patch that rebinds [menu-bar mouse-1]
to get TTY menus by default.

I'm not sure I understand the need.  E.g., the mouse-equipped w32
console doesn't need this, and neither should the GPM mouse.  Can you
explain?  Does xterm-mouse alone need it?  Also, could this affect the
GUI frames in any way?

xterm-mouse alone needs it. [menu-bar mouse-1] was already bound before my changes, so I believe it is safe. It was previously bound to tmm-menubar-mouse. This change makes it use TTY menus or tmm menus based on tty-menu-open-use-tmm, like menu-bar-open.

+(defun menu-bar-get-binding (keyseq)
+  "Return the current binding of KEYSEQ, merging prefix definitions.

This should somehow mention the menu bar, otherwise it's too general.

(For context: This is the docstring unchanged from when this function was in tmm.el. That said, I'm happy to improve it.)

I made a different change here to address. The binding lookup wasn't the interesting part, it was the reversing of the order of current-active-maps. I pulled the lookup to the caller and renamed the function entirely.

@@ -321,7 +325,8 @@ xterm-mouse-mode
   (if xterm-mouse-mode
       ;; Turn it on
       (progn
-       (setq mouse-position-function #'xterm-mouse-position-function)
+        (setq mouse-position-function #'xterm-mouse-position-function
+              tty-menu-calls-mouse-position-function t)

Can we bind tty-menu-calls-mouse-position-function only around the
code that uses the menus?  If that's not feasible, we should at least
reset it to nil when the mode is switched off.

I did the latter. It is not feasible as the menu is opened via menu-bar-open-mouse, which should not have knowledge about xterm-mouse specifically.


All other items also addressed. Updated patches attached.

  -- MJF

Attachment: 0001-Adding-mouse-controls-to-menu-bar.el.patch
Description: Text Data

Attachment: 0002-Making-TTY-menus-work-with-xterm-mouse-mode.patch
Description: Text Data

Attachment: 0003-Enabling-TTY-menus-with-xterm-mouse-mode.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]