From unknown Wed Jun 18 23:07:41 2025 X-Loop: don@donarmstrong.com Subject: bug#447: last-nonmenu-event and sub-menus Reply-To: Glenn Morris , 447@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 18 Jun 2008 23:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 447 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121383055615514 (code B ref -1); Wed, 18 Jun 2008 23:15:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.3 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 18 Jun 2008 23:09:16 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5IN9985015508 for ; Wed, 18 Jun 2008 16:09:10 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K96m4-0003MC-Hu for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K96m3-0003Lr-FG for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:07 -0400 Received: from [199.232.76.173] (port=34500 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K96m3-0003Ll-CB for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:07 -0400 Received: from fencepost.gnu.org ([140.186.70.10]:60504) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K96m3-0004Q4-15 for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:07 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1K96ju-0004ga-CO; Wed, 18 Jun 2008 19:06:54 -0400 From: Glenn Morris To: bug-gnu-emacs@gnu.org X-Spook: Iran cypherpunk Perl-RSA Bosnia national information X-Ran: Fm6=l8_J@wHKZMMcwa+Jo&<.A`CBI9ghNnIQ{i'u}2b?D#Tl6[uxc-[3XzxHrI6Jr,4\ga X-Hue: yellow X-Attribution: GM Date: Wed, 18 Jun 2008 19:06:54 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) last-nonmenu-event returns a bad value when submenus are involved. This applies to 22.2 and the current CVS. As an example: emacs -Q ;; Evaluate this code: (defun bar () (interactive) (message "%s :: %s" last-nonmenu-event (posn-window (event-start last-nonmenu-event))) (sit-for 5)) (global-set-key [down-mouse-2] '(menu-item "foo" (keymap "foo" (bar menu-item "bar" bar) (submenu menu-item "submenu" (keymap "submenu" (bar menu-item "bar" bar)))))) C-x 2 Put "scratch" in one window, "messages" in the other. Select "messages" window. Move mouse over "scratch", but do not select it. Press mouse-2, and select the "bar" menu-item. When called from the top-level menu, `bar' correctly returns: (down-mouse-2 (# 534 (251 . 101) 2649593899 nil 534 (27 . 6) nil (8 . 11) (9 . 15))) :: # When called from the submenu, `bar' returns a bad result: bar :: # The window is wrong, etc. From unknown Wed Jun 18 23:07:41 2025 X-Loop: don@donarmstrong.com Subject: bug#447: last-nonmenu-event and sub-menus Reply-To: Chong Yidong , 447@debbugs.gnu.org Resent-From: Chong Yidong Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 08 Oct 2008 22:45:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 447 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 447-submit@emacsbugs.donarmstrong.com id=B447.122350560511656 (code B ref 447); Wed, 08 Oct 2008 22:45:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 447) by emacsbugs.donarmstrong.com; 8 Oct 2008 22:40:05 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m98Me2S6011479 for <447@emacsbugs.donarmstrong.com>; Wed, 8 Oct 2008 15:40:03 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 7E32A57E218; Wed, 8 Oct 2008 18:41:45 -0400 (EDT) From: Chong Yidong To: Glenn Morris Cc: 447@debbugs.gnu.org Date: Wed, 08 Oct 2008 18:41:45 -0400 Message-ID: <8763o2yaja.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > last-nonmenu-event returns a bad value when submenus are involved. > This applies to 22.2 and the current CVS. As an example: > > emacs -Q > > ;; Evaluate this code: > (defun bar () > (interactive) > (message "%s :: %s" last-nonmenu-event > (posn-window (event-start last-nonmenu-event))) > (sit-for 5)) > (global-set-key > [down-mouse-2] > '(menu-item "foo" > (keymap "foo" > (bar menu-item "bar" bar) > (submenu menu-item "submenu" > (keymap "submenu" (bar menu-item "bar" bar)))))) > C-x 2 > Put "scratch" in one window, "messages" in the other. > Select "messages" window. > Move mouse over "scratch", but do not select it. > Press mouse-2, and select the "bar" menu-item. > > When called from the submenu, `bar' returns a bad result: > > bar :: # > > The window is wrong, etc. Hi Glenn, I can't seem to reproduce this now, using the latest Emacs CVS. Maybe it's been fixed in the meantime. Do you still see this behavior? From unknown Wed Jun 18 23:07:41 2025 X-Loop: don@donarmstrong.com Subject: bug#447: last-nonmenu-event and sub-menus Reply-To: Glenn Morris , 447@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 09 Oct 2008 17:05:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 447 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 447-submit@emacsbugs.donarmstrong.com id=B447.122357146527783 (code B ref 447); Thu, 09 Oct 2008 17:05:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.2 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,UNRESOLVED_TEMPLATE,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 447) by emacsbugs.donarmstrong.com; 9 Oct 2008 16:57:45 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m99GvZMB027777 for <447@emacsbugs.donarmstrong.com>; Thu, 9 Oct 2008 09:57:36 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1Knyn7-00068c-6i; Thu, 09 Oct 2008 12:55:09 -0400 From: Glenn Morris To: Chong Yidong Cc: 447@debbugs.gnu.org References: <8763o2yaja.fsf@cyd.mit.edu> X-Spook: Merlin oil clandestine Islam Abduganievich Karimov Rubin X-Ran: FWU/\gswH`_@_cWG]w/,]#M2i*p4>2krW\rR\#N!'aTInh4%HRIkY0$A:#ya'D'')j^WFA X-Hue: red X-Attribution: GM Date: Thu, 09 Oct 2008 12:55:09 -0400 In-Reply-To: <8763o2yaja.fsf@cyd.mit.edu> (Chong Yidong's message of "Wed, 08 Oct 2008 18:41:45 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Chong Yidong wrote: > I can't seem to reproduce this now, using the latest Emacs CVS. Maybe > it's been fixed in the meantime. Do you still see this behavior? I still see it. Do you see it with Emacs 22 even? From unknown Wed Jun 18 23:07:41 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#447: last-nonmenu-event and sub-menus Reply-To: martin rudalics , 447@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 04 Jan 2009 13:20:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 447 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 447-submit@emacsbugs.donarmstrong.com id=B447.12310746712762 (code B ref 447); Sun, 04 Jan 2009 13:20:05 +0000 Received: (at 447) by emacsbugs.donarmstrong.com; 4 Jan 2009 13:11:11 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.1 required=4.0 tests=FOURLA,MIXEDBDN, MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n04DB6q5002748 for <447@emacsbugs.donarmstrong.com>; Sun, 4 Jan 2009 05:11:08 -0800 Received: (qmail invoked by alias); 04 Jan 2009 13:11:00 -0000 Received: from 62-47-48-25.adsl.highway.telekom.at (EHLO [62.47.48.25]) [62.47.48.25] by mail.gmx.net (mp008) with SMTP; 04 Jan 2009 14:11:00 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19ts5tMk9dtH8ZZwqnjPimsnx87Bvoek4JCrbboRj gao315mf1oMMZ1 Message-ID: <4960B4AE.9070706@gmx.at> Date: Sun, 04 Jan 2009 14:07:58 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: 447@debbugs.gnu.org CC: Glenn Morris Content-Type: multipart/mixed; boundary="------------060903040001000501010605" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6,0.55 This is a multi-part message in MIME format. --------------060903040001000501010605 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > emacs -Q > > ;; Evaluate this code: > > (defun bar () > (interactive) > (message "%s :: %s" last-nonmenu-event > (posn-window (event-start last-nonmenu-event))) > (sit-for 5)) > > (global-set-key > [down-mouse-2] > '(menu-item "foo" > (keymap "foo" > (bar menu-item "bar" bar) > (submenu menu-item "submenu" > (keymap "submenu" (bar menu-item "bar" bar)))))) > > C-x 2 > Put "scratch" in one window, "messages" in the other. > Select "messages" window. > Move mouse over "scratch", but do not select it. > Press mouse-2, and select the "bar" menu-item. > > > When called from the top-level menu, `bar' correctly returns: > > (down-mouse-2 (# 534 (251 . 101) 2649593899 nil > 534 (27 . 6) nil (8 . 11) (9 . 15))) :: # > > > When called from the submenu, `bar' returns a bad result: > > bar :: # > > The window is wrong, etc. Glenn, just for fun please try the attached patch. It seems to solve your problem here but I have no idea whether it has any detrimental side-effects. martin --------------060903040001000501010605 Content-Type: text/plain; name="keyboard.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="keyboard.c.diff" *** keyboard.c.~1.986.~ 2009-01-03 17:35:34.328125000 +0100 --- keyboard.c 2009-01-04 13:59:34.328125000 +0100 *************** *** 2548,2553 **** --- 2548,2555 ---- if (CONSP (Vunread_command_events)) { + int was_disabled = 0; + c = XCAR (Vunread_command_events); Vunread_command_events = XCDR (Vunread_command_events); *************** *** 2568,2579 **** if (CONSP (c) && EQ (XCDR (c), Qdisabled) && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c)))) ! c = XCAR (c); /* If the queued event is something that used the mouse, set used_mouse_menu accordingly. */ if (used_mouse_menu ! && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar))) *used_mouse_menu = 1; goto reread_for_input_method; --- 2570,2584 ---- if (CONSP (c) && EQ (XCDR (c), Qdisabled) && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c)))) ! { ! was_disabled = 1; ! c = XCAR (c); ! } /* If the queued event is something that used the mouse, set used_mouse_menu accordingly. */ if (used_mouse_menu ! && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar) || was_disabled)) *used_mouse_menu = 1; goto reread_for_input_method; --------------060903040001000501010605-- From unknown Wed Jun 18 23:07:41 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#447: last-nonmenu-event and sub-menus Reply-To: Glenn Morris , 447@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 09 Jan 2009 20:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 447 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 447-submit@emacsbugs.donarmstrong.com id=B447.123153139118285 (code B ref 447); Fri, 09 Jan 2009 20:10:03 +0000 Received: (at 447) by emacsbugs.donarmstrong.com; 9 Jan 2009 20:03:11 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=MURPHY_DRUGS_REL8, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n09K38hZ018279 for <447@emacsbugs.donarmstrong.com>; Fri, 9 Jan 2009 12:03:09 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LLNYH-0004z5-6Y; Fri, 09 Jan 2009 15:01:53 -0500 From: Glenn Morris To: martin rudalics Cc: 447@debbugs.gnu.org References: <4960B4AE.9070706@gmx.at> X-Spook: Semtex Axis of Evil event security Reno AVIP Commecen X-Ran: M{er3Wq-~oO!Dfm19ah7Z_JZp<%@e3ToQk'7r/bg4s@`;Z8]z$Mb1^ZIJ'Rq[]u\dsySI! X-Hue: magenta X-Attribution: GM Date: Fri, 09 Jan 2009 15:01:53 -0500 In-Reply-To: <4960B4AE.9070706@gmx.at> (martin rudalics's message of "Sun, 04 Jan 2009 14:07:58 +0100") Message-ID: <0mocygdz9q.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii martin rudalics wrote: > Glenn, just for fun please try the attached patch. It seems to solve > your problem here but I have no idea whether it has any detrimental > side-effects. Yes, it seems to fix the problem, thank you. From unknown Wed Jun 18 23:07:41 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Glenn Morris Subject: bug#447 closed by martin rudalics (Re: last-nonmenu-event and sub-menus) Message-ID: References: <496B1454.4020409@gmx.at> X-Emacs-PR-Message: they-closed 447 X-Emacs-PR-Package: emacs Reply-To: 447@debbugs.gnu.org Date: Mon, 12 Jan 2009 10:05:06 +0000 Content-Type: multipart/mixed; boundary="----------=_1231754706-4795-1" This is a multi-part message in MIME format... ------------=_1231754706-4795-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #447: last-nonmenu-event and sub-menus It has been closed by martin rudalics . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact martin rudalics by replying to this email. --=20 447: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D447 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1231754706-4795-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 447-done) by emacsbugs.donarmstrong.com; 12 Jan 2009 09:59:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n0C9xcO3002642 for <447-done@emacsbugs.donarmstrong.com>; Mon, 12 Jan 2009 01:59:40 -0800 Received: (qmail invoked by alias); 12 Jan 2009 09:59:32 -0000 Received: from 62-47-34-88.adsl.highway.telekom.at (EHLO [62.47.34.88]) [62.47.34.88] by mail.gmx.net (mp006) with SMTP; 12 Jan 2009 10:59:32 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18+mwpPM5k+NzMTfGvFeEjBFKm3UbVgBxjEO9bHi3 kwUENVSs7Eh8mJ Message-ID: <496B1454.4020409@gmx.at> Date: Mon, 12 Jan 2009 10:58:44 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: 447-done@debbugs.gnu.org CC: Glenn Morris Subject: Re: last-nonmenu-event and sub-menus References: <4960B4AE.9070706@gmx.at> <0mocygdz9q.fsf@fencepost.gnu.org> In-Reply-To: <0mocygdz9q.fsf@fencepost.gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.76 Fixed as * keyboard.c (read_char): Fix case where last_nonmenu_event returned a bad value with submenus. (Bug#447) martin ------------=_1231754706-4795-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From rgm@gnu.org Wed Jun 18 16:09:15 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.3 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 18 Jun 2008 23:09:16 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5IN9985015508 for ; Wed, 18 Jun 2008 16:09:10 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K96m4-0003MC-Hu for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K96m3-0003Lr-FG for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:07 -0400 Received: from [199.232.76.173] (port=34500 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K96m3-0003Ll-CB for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:07 -0400 Received: from fencepost.gnu.org ([140.186.70.10]:60504) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K96m3-0004Q4-15 for bug-gnu-emacs@gnu.org; Wed, 18 Jun 2008 19:09:07 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1K96ju-0004ga-CO; Wed, 18 Jun 2008 19:06:54 -0400 From: Glenn Morris To: bug-gnu-emacs@gnu.org Subject: last-nonmenu-event and sub-menus X-Spook: Iran cypherpunk Perl-RSA Bosnia national information X-Ran: Fm6=l8_J@wHKZMMcwa+Jo&<.A`CBI9ghNnIQ{i'u}2b?D#Tl6[uxc-[3XzxHrI6Jr,4\ga X-Hue: yellow X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 18 Jun 2008 19:06:54 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) last-nonmenu-event returns a bad value when submenus are involved. This applies to 22.2 and the current CVS. As an example: emacs -Q ;; Evaluate this code: (defun bar () (interactive) (message "%s :: %s" last-nonmenu-event (posn-window (event-start last-nonmenu-event))) (sit-for 5)) (global-set-key [down-mouse-2] '(menu-item "foo" (keymap "foo" (bar menu-item "bar" bar) (submenu menu-item "submenu" (keymap "submenu" (bar menu-item "bar" bar)))))) C-x 2 Put "scratch" in one window, "messages" in the other. Select "messages" window. Move mouse over "scratch", but do not select it. Press mouse-2, and select the "bar" menu-item. When called from the top-level menu, `bar' correctly returns: (down-mouse-2 (# 534 (251 . 101) 2649593899 nil 534 (27 . 6) nil (8 . 11) (9 . 15))) :: # When called from the submenu, `bar' returns a bad result: bar :: # The window is wrong, etc. ------------=_1231754706-4795-1--