GNU bug report logs -
#7691
24.0.50; x-popup-menu with keymap - :help keyword
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Mon, 20 Dec 2010 21:07:02 UTC
Severity: minor
Found in version 24.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7691 in the body.
You can then email your comments to 7691 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Mon, 20 Dec 2010 21:07:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 20 Dec 2010 21:07:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
`x-popup-menu's doc says that it accepts a keymap or a list of keymaps
as its second arg, which it does.
The advantage of using a keymap instead of the alternative "multiple
panes" format as the second arg is that keymap keywords (e.g. :enable)
are honored.
And keywords seem to work OK - except for :help. Example:
(defun eee (event)
(interactive "e")
(x-popup-menu
event '(keymap "The Menu"
(foo menu-item "Foo" 'forward-char
:enable pop-up-frames
:help "WHY DOESN'T THIS SHOW UP?"))))
(global-set-key [(control mouse-3)] nil)
(global-set-key [(control down-mouse-3)] 'eee)
Then `C-mouse-3'. Turn `pop-up-frames' on and off to see that :enable
works.
But put the pointer over item `Foo' in the menu and you will not see the
:help displayed. This is true also if `tooltip-mode' is off (the help
does not show in the minibuffer/echo area).
There is this note in `(elisp) Pop-Up Menus':
"Don't use `x-popup-menu' to display a menu if you
could do the job with a prefix key defined with a menu
keymap. If you use a menu keymap to implement a menu,
`C-h c' and `C-h a' can see the individual items in that
menu and provide help for them. If instead you implement
the menu by defining a command that calls `x-popup-menu',
the help facilities cannot know what happens inside that
command, so they cannot give any help for the menu's items."
I cannot tell if that note is supposed to speak to the limitation/bug
I'm reporting. First, "use a menu keymap" is not the same thing as
using a prefix key defined with a menu keymap. In the example I show
above, I do "use a keymap".
Second, what I'm looking for here is a tooltip displaying the :help
string - not `C-h c' etc.
Third, if that note is indeed meant to apply also to the limitation/bug
I'm reporting, then I don't understand the reason given for that. If
:enable, :visible, etc. can be handled, why couldn't :help also be
handled?
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
of 2010-12-20 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags
-Ic:/imagesupport/include'
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Mon, 20 Dec 2010 21:25:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 7691 <at> debbugs.gnu.org (full text, mbox):
> (foo menu-item "Foo" 'forward-char
I meant this:
(foo menu-item "Foo" forward-char
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Mon, 20 Dec 2010 22:17:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 7691 <at> debbugs.gnu.org (full text, mbox):
> But put the pointer over item `Foo' in the menu and you will not see the
> :help displayed. This is true also if `tooltip-mode' is off (the help
> does not show in the minibuffer/echo area).
Looks like a bug, indeed. Might be a very longstanding one.
It's probably some missing code somewhere.
> There is this note in `(elisp) Pop-Up Menus':
> "Don't use `x-popup-menu' to display a menu if you
> could do the job with a prefix key defined with a menu
> keymap.
[...]
> I cannot tell if that note is supposed to speak to the limitation/bug
> I'm reporting.
No relation: it talks about when to use x-popup-menu, not about how to
use it. Also it talks about C-h c rather than tooltip help.
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Mon, 20 Dec 2010 22:36:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 7691 <at> debbugs.gnu.org (full text, mbox):
> Looks like a bug, indeed. Might be a very longstanding one.
> It's probably some missing code somewhere.
Glad you see it the same way. I hope it can be fixed.
> No relation: it talks about when to use x-popup-menu, not about how to
> use it. Also it talks about C-h c rather than tooltip help.
Yes, that was my reading too. Guess I'm just conditioned to expect "Not a
bug!", so I stretched for a misunderstanding on my part. Sometimes it's hard to
tell whether the doc is unclear/misleading or the product is bugged (or both).
;-)
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Mon, 20 Dec 2010 23:00:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 7691 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> But put the pointer over item `Foo' in the menu and you will not see the
>> :help displayed. This is true also if `tooltip-mode' is off (the help
>> does not show in the minibuffer/echo area).
>
> Looks like a bug, indeed. Might be a very longstanding one.
> It's probably some missing code somewhere.
IIRC it is not possible to display tooltips while popup menus are
displayed on Windows, as creating the tooltip involves Windows messages
to the same thread that the popup menu is blocking. But the help message
should be displayed in the minibuffer.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Mon, 20 Dec 2010 23:13:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 7691 <at> debbugs.gnu.org (full text, mbox):
> IIRC it is not possible to display tooltips while popup menus are
> displayed on Windows, as creating the tooltip involves
> Windows messages to the same thread that the popup menu is
> blocking.
Poor Windows. ;-)
Does this work OK on other platforms?
IOW, is the bug itself Windows-specific?
> But the help message should be displayed in the minibuffer.
Yes, that would be OK.
Would this (fixed) behavior be Windows-specific?
Should this behavior be mentioned in the `x-popup-menu' doc? If not, someone
might well report a bug saying that the code doesn't respect `tooltip-mode'
(since it always puts the help in the minibuffer).
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Tue, 21 Dec 2010 02:06:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 7691 <at> debbugs.gnu.org (full text, mbox):
On Tue, Dec 21, 2010 at 12:17 AM, Drew Adams <drew.adams <at> oracle.com> wrote:
>> IIRC it is not possible to display tooltips while popup menus are
>> displayed on Windows, as creating the tooltip involves
>> Windows messages to the same thread that the popup menu is
>> blocking.
>
> Poor Windows. ;-)
Or maybe it is rather "poor Emacs" here.
Jason, I do not understand exactly why the blocking occurs. Which
thread is blocked and why is it necessary?
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Tue, 21 Dec 2010 03:27:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 7691 <at> debbugs.gnu.org (full text, mbox):
On 21/12/2010 10:11, Lennart Borgman wrote:
> Or maybe it is rather "poor Emacs" here.
>
> Jason, I do not understand exactly why the blocking occurs. Which
> thread is blocked and why is it necessary?
>
If you have any clever ideas about how to "Pop up a deck-of-cards menu
and return user's selection." without blocking, then please share them.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Tue, 21 Dec 2010 11:15:02 GMT)
Full text and
rfc822 format available.
Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):
> If you have any clever ideas about how to "Pop up a deck-of-cards menu and
> return user's selection." without blocking, then please share them.
Now that "clever idea" exists as long as GUI toolkits are around: Don't
use a command loop in your application, use event callbacks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#7691
; Package
emacs
.
(Thu, 28 Apr 2016 09:51:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 7691 <at> debbugs.gnu.org (full text, mbox):
"Drew Adams" <drew.adams <at> oracle.com> writes:
> And keywords seem to work OK - except for :help. Example:
>
> (defun eee (event)
> (interactive "e")
> (x-popup-menu
> event '(keymap "The Menu"
> (foo menu-item "Foo" 'forward-char
> :enable pop-up-frames
> :help "WHY DOESN'T THIS SHOW UP?"))))
>
> (global-set-key [(control mouse-3)] nil)
> (global-set-key [(control down-mouse-3)] 'eee)
>
> Then `C-mouse-3'. Turn `pop-up-frames' on and off to see that :enable
> works.
>
> But put the pointer over item `Foo' in the menu and you will not see the
> :help displayed.
This seems like it has been fixed now.
(defun eee (event)
(interactive "e")
(x-popup-menu
event '(keymap "The Menu"
(foo menu-item "Foo" forward-char
:enable pop-up-frames
:help "WHY DOESN'T THIS SHOW UP?"))))
(global-set-key [(control mouse-3)] nil)
(global-set-key [(control down-mouse-3)] 'eee)
works for me.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug closed, send any further explanations to
7691 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 28 Apr 2016 09:51:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 26 May 2016 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 9 years and 28 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.