Ben:
We have a problem on MS Windows where choice menus in Custom don't
work. What happens is that Custom constructs a menu of the form
("menu"
["first" ("first") t]
["second" ("second") t])
and calls `get-popup-menu-response' on it. Custom takes the event
returned, throws away the event-function (which is always `eval'),
grabs the car out of event-object, and returns it to the calling code.
In the MS Windows port under some circumstances this event is being
"executed", resulting in an attempt to funcall a string.
Andy thinks the idiom Custom is using requires unholy knowledge of the
implementation, I think it's a bit hackish, but is correct and should
be documented. I don't understand why MS Windows port barfs. Further
analysis follows.
Can you shed any light on this?
>>>> "Andy" == Andy Piper <andyp(a)bea.com>
writes:
Andy> I still don't get it. get-popup-menu-response creates a
Andy> popup menu when when selected enqueues a misc ue with fn ==
Andy> eval and data == '("first"),
Not according to the docs:
------------------------------------------------------------------------
`get-popup-menu-response' is a compiled Lisp function
-- loaded from "/home/steve/Projects/XEmacs/Builds/21.4/lisp/menubar.elc"
(get-popup-menu-response MENU-DESC &optional EVENT)
Documentation:
Pop up the given menu and wait for a response.
This blocks until the response is received, and returns the misc-user
event that encapsulates the response. To execute it, you can do
(funcall (event-function response) (event-object response))
If no response was received, nil is returned.
MENU-DESC and EVENT are as in the call to `popup-menu'.
------------------------------------------------------------------------
Says nothing about "enqueue", and clearly implies that it won't be
enqueued by the comment about "you can". See also
`popup-menu-and-execute-in-window'.
Andy> fn is applied to data all hell breaks loose. If I put debug
Andy> code in menubar-msw.c I can see this happening.
Probably menubar-msw is being too helpful, and automatically
enqueuing.
> So you're going to have to figure out how that thing is
getting
> executed, because it's not happenning in Lisp, and evidently it
> doesn't happen on X.
Andy> I still don't see why it doesn't happen on X.
Because the API as documented above says (implies, that this is not
made clear is a bug) that it isn't supposed to.
Andy> Also, whether it works under X or not seems irrelevant, the
Andy> implementation is relying on some undocumented vagary of the
Andy> runtime. Seems bogus to me.
No, it's all documented, at least by implication and in context of
other functions available.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Don't ask how you can "do" free software business;
ask what your business can "do for" free software.