From: "David Vanderschel" <DJV1@Austin.RR.com>
Subject: elisp mouse programming problems
Date: Tue, 19 Aug 2003 22:17:22 -0500 [thread overview]
Message-ID: <TqWcnRRLgfHedd-iRTvUqg@texas.net> (raw)
I am having a problem with overriding the global map
for some mouse events. For example, I can bind
C-mouse-1 in a major mode mode-map for a major mode I
created. Yet when that mode is in effect, such a
mouse click still goes to mouse-select-buffer (as it
is correctly bound globally) and never reaches the
function I bound to the key for the mode. I do not
have this problem with all mouse events, and I cannot
figure out what is going wrong. I am consistently
successful in overriding the global binding of
ordinary key sequences (as opposed to mouse events) in
this manner. Extra details appended.
Also, in testing such things, I am confused by the
fact that I cannot seem to redefine the bindings of a
mode-map by simply setting it to nil and rerunning the
(modified) code which builds the mode-map. The old
bindings seem to remain in effect. If I kill emacs
and restart it, the changed bindings do take effect.
Not even killing the buffer with the new mode,
reloading the file which defines the program, and
rerunning the program which creates the special mode
buffer helps. What is it that I do not understand
here?
If it matters (which I doubt), I am still running
20.7.3 (on Windows 98).
Thanks for any pointers,
David V.
______________________________________________________________________
More details:
I have the following code I have been fooling with:
(when (null Hube-mode-map)
(let ( (m (make-sparse-keymap)) )
(suppress-keymap m t)
(define-key m [double-mouse-1] 'Hube-double-mouse-1)
(define-key m [drag-mouse-1] 'Hube-mouse-1-up)
(define-key m [drag-mouse-2] 'Hube-mouse-2-up-test)
(define-key m [C-S-mouse-1] 'Hube-control-mouse-1)
(define-key m [C-mouse-1] 'Hube-control-mouse-1)
(define-key m [down-mouse-1] 'Hube-mouse-1-down)
(define-key m [mouse-1] 'Hube-mouse-1-up)
(define-key m [mouse-2] 'Hube-mouse-2)
(define-key m [(control n)] 'dv-test2)
(setq Hube-mode-map m)
))
The bindings which fail to work are those for
C-mouse-1 and drag-mouse-2. They keep getting handled
by the functions which are bound to them globally.
All the others do work as I expect - and note that
many of them are things which do have standard global
bindings in emacs. In my initialization, I have
explicitly bound drag-mouse-2 globally to
mouse-drag-throw in mouse-extras.el. (Used that for
years!) C-mouse-1 is bound by the msb package which I
use. I introduced the C-n just to demonstrate that a
"control" modifier was not the source of my apparent
problem. I also tried to rebind S-mouse-1 and it
persisted in invoking mouse-set-font. Hube-mode does
not use any other modes.
next reply other threads:[~2003-08-20 3:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-20 3:17 David Vanderschel [this message]
2003-08-20 10:34 ` elisp mouse programming problems Alex Schroeder
2003-08-21 1:46 ` David Vanderschel
2003-08-21 2:37 ` Johan Bockgård
2003-08-21 3:24 ` David Vanderschel
2003-08-21 17:44 ` Kevin Rodgers
2003-08-22 0:50 ` David Vanderschel
2003-08-22 15:24 ` Kevin Rodgers
2003-08-20 11:40 ` Eli Zaretskii
[not found] ` <mailman.542.1061395718.29551.help-gnu-emacs@gnu.org>
2003-08-21 3:12 ` David Vanderschel
2003-08-21 12:19 ` Alex Schroeder
2003-08-22 0:34 ` David Vanderschel
2003-08-22 15:20 ` Kevin Rodgers
2003-08-27 17:45 ` Kai Großjohann
2003-08-27 20:27 ` Kai Großjohann
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=TqWcnRRLgfHedd-iRTvUqg@texas.net \
--to=djv1@austin.rr.com \
/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.
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).