GNU bug report logs - #16565
24.3.50; x-popup-menu just returns nil

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 27 Jan 2014 02:52:02 UTC

Severity: normal

Found in version 24.3.50

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 16565 <at> debbugs.gnu.org
Subject: bug#16565: 24.3.50; x-popup-menu just returns nil
Date: Tue, 28 Jan 2014 05:47:25 +0200
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: 16565 <at> debbugs.gnu.org
> Date: Tue, 28 Jan 2014 04:11:42 +0100
> 
> Ok, I tried to do my best to understand the C code and GUD.
> 
> If I understand correctly, this is executed for me:
> 
>     selection = xmenu_show (f, xpos, ypos, for_click,
> 			    keymaps, title, &error_name);
> 
> In the good case, SELECTION is bound to different integers, in the bad
> case, it is always the same integer, which seems to mean "nil".

If you start GDB in the src directory, or let it otherwise read the
file src/.gdbinit, you can know for sure: the "xtype" command will
tell you what kind of Lisp data is in 'selection':

  (gdb) p selection
  (gdb) xtype

If "xtype" says it's a Lisp symbol, another command "xsymbol" will
tell you what symbol is that, it will say "nil" if it is nil.

> But there is a difference in the arguments of the xmenu_show call.  In
> the bad case calling with an event:
> 
>   (x-popup-menu event (mouse-menu-bar-map))
> 
> FOR_CLICK is bound to true.  In the good case with
> 
>   (x-popup-menu t (mouse-menu-bar-map))
> 
> FOR_CLICK is bound to false.
> 
> That made me wonder what happened when I bind `foo' to a mouse-down
> event.  Then the bug doesn't happen, `foo' doesn't return nil.

In general, as long as the menu pops up, you should see the selection
made by the user.  The binding should only determine whether the menu
pops up or not, AFAIK.




This bug report was last modified 11 years and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.