From: "Ye Wenbin" <wenbinye@gmail.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: What is the difference between down-mouse-3 and mouse-3
Date: Tue, 15 Apr 2008 23:06:27 +0800 [thread overview]
Message-ID: <op.t9nqw1uq52p72k@ywb-laptop> (raw)
In-Reply-To: <jwvej97dvp3.fsf-monnier+emacs@gnu.org>
On Tue, 15 Apr 2008 22:45:52 +0800, Stefan Monnier
<monnier@iro.umontreal.ca> 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
next prev parent reply other threads:[~2008-04-15 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-15 4:38 What is the difference between down-mouse-3 and mouse-3 Ye Wenbin
2008-04-15 14:45 ` Stefan Monnier
2008-04-15 15:06 ` Ye Wenbin [this message]
2008-04-15 17:37 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.t9nqw1uq52p72k@ywb-laptop \
--to=wenbinye@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).