unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "David Vanderschel" <DJV1@Austin.RR.com>
Subject: Re: elisp mouse programming problems
Date: Wed, 20 Aug 2003 22:12:09 -0500	[thread overview]
Message-ID: <8SidnSEhNIsRpdmiRTvUpQ@texas.net> (raw)
In-Reply-To: mailman.542.1061395718.29551.help-gnu-emacs@gnu.org

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

  parent reply	other threads:[~2003-08-21  3:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-20  3:17 elisp mouse programming problems David Vanderschel
2003-08-20 10:34 ` 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 [this message]
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=8SidnSEhNIsRpdmiRTvUpQ@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).