From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Making TTY menus more visual Date: Mon, 12 Oct 2020 17:45:55 +0300 Message-ID: <83362j4i58.fsf@gnu.org> References: <087df85a965fac6555a755c1bbebf1ea@finder.org> <83r1qhf5ii.fsf@gnu.org> <83wo07g0bf.fsf@gnu.org> <85afa5c0a0a789c6047e92f6ecfa9fcc@finder.org> <72bbff31bcf46be917c9e8d8236cad75@finder.org> <838scmfq4f.fsf@gnu.org> <83y2kme50p.fsf@gnu.org> <033517da1ce6762b3d3c656dad4d8f98@finder.org> <835z7pdvcp.fsf@gnu.org> <0168b49ea0f2b5533f6e20c6ad73eb0c@finder.org> <835z7l876k.fsf@gnu.org> <54d686f28c49c0b86c4a52ba48cf2486@finder.org> <83sgan5to0.fsf@gnu.org> <78d53fb994e86bb2d8c7fd313cdfa8a2@finder.org> <83blha5yla.fsf@gnu.org> <184d04bc36d1a7204238d8508ec48531@finder.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22409"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Jared Finder Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 12 16:50:53 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRzA5-0005ie-VG for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Oct 2020 16:50:53 +0200 Original-Received: from localhost ([::1]:44130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRzA5-0000Zt-1f for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Oct 2020 10:50:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRz5D-0004Kk-3q for emacs-devel@gnu.org; Mon, 12 Oct 2020 10:45:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44156) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRz5C-0000Yt-HL; Mon, 12 Oct 2020 10:45:50 -0400 Original-Received: from [176.228.60.248] (port=1554 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kRz5B-0004VX-Tq; Mon, 12 Oct 2020 10:45:50 -0400 In-Reply-To: <184d04bc36d1a7204238d8508ec48531@finder.org> (message from Jared Finder on Sun, 11 Oct 2020 20:25:13 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:257469 Archived-At: > Date: Sun, 11 Oct 2020 20:25:13 -0700 > From: Jared Finder > 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?