help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elisp mouse programming problems


From: David Vanderschel
Subject: Re: elisp mouse programming problems
Date: Wed, 20 Aug 2003 22:12:09 -0500

"Eli Zaretskii" <eliz@elta.co.il> wrote in message
news:mailman.542.1061395718.29551.help-gnu-emacs@gnu.org...
> > From: "David Vanderschel" <DJV1@Austin.RR.com>
> > Newsgroups: gnu.emacs.help
> > Date: Tue, 19 Aug 2003 22:17:22 -0500

> > 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.

> Did you try to bind C-down-mouse-1 to the same command?

I have now.  See my response to Alex.

> The Elisp manual has a chapter about mouse events
> that you may wish to read.

Believe me, I have read it!

> > 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.

> What does Emacs say when you type "C-h c" followed
> by one of those two mouse gestures that fail?

This is awkward with mouse events - since pressing and
releasing a mouse button generates multiple events,
and it may report on an event different from the one I
am concerned with.

However, this did give me a clue which enabled me to
fix my drag-mouse-2.  Even though I did not get a
report on drag-mouse-2, what C-h c did report was:

    down-mouse-2 at that spot runs the command mouse-drag-throw

I suppose that once mouse-drag-throw was running it
took away _my_ drag.  I have now bound down-mouse-2 to
a no op in my mode, and the function I had intended
for drag-mouse-2 now works!  Alex was more nearly
correct on this than I had initially thought.

But I was STILL unable to usurp C-down-mouse-1!  I
have bound a test function to it, and it does not run.
C-h c still says:

   C-down-mouse-1 at that spot runs the command msb

I have now solved that one too, and the reason was
something which has not been mentioned; but it also
raises a new question.  The problem was that the minor
mode msb was enabling itself in all my buffers (which
is normally OK).  Once I disabled msb-mode in my
special buffer, all was well.  But why would a binding
for a minor mode take precedence when I had attempted
to bind the same event in my major mode?  How can a
general purpose program like I am trying to make know,
in general, which minor modes it must disable in order
to work properly?  I feel that I must still be missing
something here.

Thanks,
  David V.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]