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: Thu, 21 Aug 2003 01:46:41 GMT	[thread overview]
Message-ID: <5wV0b.2124$pW3.242047@twister.austin.rr.com> (raw)
In-Reply-To: 873cfwvcqp.fsf@emacswiki.org

"Alex Schroeder" <alex@emacswiki.org> wrote in message
news:873cfwvcqp.fsf@emacswiki.org...
> "David Vanderschel" <DJV1@Austin.RR.com> writes:
> > I am having a problem with overriding the global
> > map ...

> One mouse click will generate not only the mouse
> click event, but also a button-down event.  And if
> somebody binds a command to the button-down event,
> then the command bound to the click event is never
> called.

That is new information for me, but I do not think
that this would not explain why I cannot override
drag-mouse-2.

My whole problem is that only certain bindings fail,
and I can't see the difference.

In one failure case, we are talking about C-down-mouse-1.
So I have tried to experiment more with that.  When I
look in my new mode-map, I see the pair:

     (C-down-mouse-1 . dv-test1)

When I do C-h c for C-down-mouse-1, I still get:

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

My own major mode mode-map was definitely in effect
(for other things I bound specially) in the buffer in
which I tried that.

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

> A keymap is a list that starts with the symbol `keymap'.
>Only the cdr of that list is used by Emacs when
>looking up keys.  When you just change the value of a
>mode-map, the old cdr will still be used.  (Maybe you
>need to draw box diagrams to see this.)

When I said "setting it to nil" I was talking about
the pointer to the list (Hube-mode-map, in my case).
Thus regenerating that list should also generate a new
cdr.  If emacs still has a pointer to the old cdr, I
need to know how to get emacs to give it up.  What
makes it adopt the cdr in the first place?

I think I have now figured this one out.  Changing the
mode-map itself is not sufficient.  You must again
invoke (use-local-map whatever-mode-map).  (I had
erroneously believed that what emacs remembered was my
variable which held the pointer to the mode-map and
that it would use the new map when I changed it.  But
there is no quote on the argument, so it cannot know.
I now recall running into another manifestation of
this.  emacs will readily show you the current
mode-map, but it is difficult to discover the 'name'
of that map - ie., the variable used to create it.)

> The correct solution depends on where the bindings
> are:  Global map?  Local map?  Overlays?  Text
> properties?

The case I am concerned with occurs when the bindings
are in the major mode mode-map which I am working on
now.

Thanks,
  David V.

  reply	other threads:[~2003-08-21  1:46 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 [this message]
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='5wV0b.2124$pW3.242047@twister.austin.rr.com' \
    --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).