[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is the difference between down-mouse-3 and mouse-3
From: |
Ye Wenbin |
Subject: |
Re: What is the difference between down-mouse-3 and mouse-3 |
Date: |
Tue, 15 Apr 2008 23:06:27 +0800 |
User-agent: |
Opera Mail/9.25 (Linux) |
On Tue, 15 Apr 2008 22:45:52 +0800, Stefan Monnier
<address@hidden> wrote:
Don't know, it works for me (tried both with the trunk and with 22.1).
What do you mean by "does not work"?
Really, I test both emacs22 (GNU Emacs 22.1.1 (i486-pc-linux-gnu,
GTK+ Version 2.10.11) of 2007-11-21 on vernadsky)
and emacs23(GNU Emacs 23.0.60.7 (i686-pc-linux-gnu, GTK+ Version 2.10.11)
of 2008-03-29 on ywb-laptop),
if bind the menu to mouse-3, the command in submenu does not called. I
test as following:
1. `emacs -q' start emacs
2. in *scratch* buffer, paste code:
(define-derived-mode foo-mode text-mode "Foo"
"Test major mode"
)
(easy-menu-define foo-menu foo-mode-map "My own menu"
'("Foo"
["Next Line" next-line t]
("Sub Menu"
["Previous Line" previous-line t])))
(define-key foo-mode-map [mouse-3] 'mouse-popup-menubar-stuff)
3. M-x eval-buffer
4. click right mouse button, select "Sub Menu" "Previous Line", the
cursor does not
go to previous line, but if select "Next Line", the cursor moves.
This said, binding it to down-mouse-3 is *much* better so you can do
"press-button, select-entry, release-button".
That may be the answer. But if it is true that bind mouse menu to mouse-3
doesn't work for submenu,
I think the elisp manual should emphasize this. After I figure out the
problem, I only find a paragraph
metion it:
22.17.2 Menus and the Mouse
It's often best to use a button-down event to trigger the menu. Then
the user can select a menu item by releasing the button.
--
Best Regards,
Ye Wenbin