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: Eli Zaretskii
Subject: Re: Making TTY menus more visual
Date: Mon, 12 Oct 2020 17:45:55 +0300

> Date: Sun, 11 Oct 2020 20:25:13 -0700
> From: Jared Finder <jared@finder.org>
> Cc: emacs-devel@gnu.org
> 
> While working on the next feature I wanted to get working with 
> xterm-mouse (help-echo and mouse-face text properties), I noticed a bug. 
> Attached is a patch to apply after the rest of the changes to fix the 
> issue.

Thanks.

> -(defun menu-bar-open-mouse (event)
> +(defun menu-bar-open-mouse (position)
>    "Open the menu bar for the menu item clicked on by the mouse.
> -EVENT should be a mouse down or click event.
> +POSITION should be a list of the form returned by `mouse-position'.
>  
>  Also see `menu-bar-open', which this calls.
>  This command is to be used when you click the mouse in the menubar."
> -  (interactive "e")
> -  (let* ((x-position (car (posn-x-y (event-start event))))
> +  (interactive (list (mouse-position)))
> +  (let* ((x-position (cadr position))

I'd prefer not to lose the "e" interactive spec and the form of the
argument here.  If the problem is the conversion of window-relative to
frame-relative coordinates, that is easy, and the ELisp manual has an
example of how to do that in the node "Accessing Mouse".

Or is there some problem to use this here?



reply via email to

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