emacs-devel
[Top][All Lists]
Advanced

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

popup-menu with keyboard menu


From: Stephen Leake
Subject: popup-menu with keyboard menu
Date: Sat, 27 Sep 2008 15:48:36 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt)

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




reply via email to

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