From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: popup-menu with keyboard menu Date: Sat, 27 Sep 2008 15:48:36 -0400 Message-ID: References: <86wsgya51q.fsf@blue.stonehenge.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222544943 28071 80.91.229.12 (27 Sep 2008 19:49:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Sep 2008 19:49:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 27 21:50:01 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kjfni-0004I8-4r for ged-emacs-devel@m.gmane.org; Sat, 27 Sep 2008 21:49:58 +0200 Original-Received: from localhost ([127.0.0.1]:57853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kjfma-00025R-Lu for ged-emacs-devel@m.gmane.org; Sat, 27 Sep 2008 15:48:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjfmV-00024f-5e for emacs-devel@gnu.org; Sat, 27 Sep 2008 15:48:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjfmU-00024A-6c for emacs-devel@gnu.org; Sat, 27 Sep 2008 15:48:42 -0400 Original-Received: from [199.232.76.173] (port=53977 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjfmT-000246-U3 for emacs-devel@gnu.org; Sat, 27 Sep 2008 15:48:41 -0400 Original-Received: from qmta01.emeryville.ca.mail.comcast.net ([76.96.30.16]:38372) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KjfmT-0002Cg-O7 for emacs-devel@gnu.org; Sat, 27 Sep 2008 15:48:42 -0400 Original-Received: from OMTA12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by QMTA01.emeryville.ca.mail.comcast.net with comcast id Ktau1a00D0x6nqcA1voK3Z; Sat, 27 Sep 2008 19:48:19 +0000 Original-Received: from LM000850872 ([98.233.81.189]) by OMTA12.emeryville.ca.mail.comcast.net with comcast id Kvod1a009454uzm8Yvoe3W; Sat, 27 Sep 2008 19:48:39 +0000 X-Authority-Analysis: v=1.0 c=1 a=Xff7M2EJOkdx-lesjx4A:9 a=-Mwde8e90SBGQ_iHQkEKdEMRmCgA:4 a=CWfAmLVWKswA:10 In-Reply-To: (Adrian Robert's message of "Sat\, 27 Sep 2008 16\:52\:09 +0000 \(UTC\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104196 Archived-At: I'm calling popup-menu with a keyboard menu, rather than from a mouse action. It's failing with "Wrong type argument: integerp, nil" if the mouse is outside the Emacs frame (which it normally is, for me). This patch fixes the problem: =================================================================== RCS file: /sources/emacs/emacs/lisp/mouse.el,v retrieving revision 1.347 diff -u -r1.347 mouse.el --- lisp/mouse.el 11 Aug 2008 01:23:05 -0000 1.347 +++ lisp/mouse.el 27 Sep 2008 19:36:59 -0000 @@ -109,9 +109,7 @@ (plist-get (get map 'menu-prop) :filter)))) (if filter (funcall filter (symbol-function map)) map))))) event cmd) - (unless position - (let ((mp (mouse-pixel-position))) - (setq position (list (list (cadr mp) (cddr mp)) (car mp))))) + (unless position (setq position t)) ;; The looping behavior was taken from lmenu's popup-menu-popup (while (and map (setq event ;; map could be a prefix key, in which case =================================================================== 'position' is later passed to x-popup-menu, which properly handles the case of the mouse being outside the frame. -- -- Stephe