all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: cyd@stupidchicken.com, emacs-devel@gnu.org, storm@cua.dk
Subject: Re: local keymap patch for key-binding
Date: Tue, 12 Sep 2006 12:04:01 +0200	[thread overview]
Message-ID: <85hczdbdv2.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1GMrux-0007sl-E0@fencepost.gnu.org> (Richard Stallman's message of "Mon\, 11 Sep 2006 15\:58\:07 -0400")

Richard Stallman <rms@gnu.org> writes:

>      (`key-binding' can't be used to look up events, and I am less
>     than certain that it should).
>
> Of course key-binding can be used to look up events.  If you want to
> look them up in the current active keymaps, key-binding is the
> natural way.

I think we are talking about different things here.  Call
M-: (eventp (read-key-sequence nil)) RET
and click with the mouse somewhere.  You will get "nil" as a result
since read-key-sequence does not return an event, but rather an array
with the 0th element being an event.

key-binding in its current code by Chong can only deal with such an
event _sequence_ (which is not an event according to eventp).

If you thing it reasonable that key-binding should also react to
bona-fide events _not_ wrapped in an array, I can do this easily
enough in the change I am working on.

> The recent change affects the lookup of events that specify
> positions.  It has no effect on what happens if you pass a list of
> event-types without positions.
>
> Perhaps there is a misunderstanding here about what it means
> to "look up events".
>
>     a) add an additional optional parameter BASE-KEY which, when non-NIL,
>     will replace KEY for all purposes of lookup except determining the
>     keymaps to use when KEY is a key-sequence based on an event.
>
> I don't follow this at all, sorry.

We have the situation that we want to look up an artificial
"follow-link" keymap entry depending on the keymaps where a click was
made.  It would be nice to do this with

(key-binding click-event nil nil 'follow-link)

>     b) have a function `event-replace-key' or something with a
>     better name which will take a key sequence based on an event and
>     swap out the basic event (but maybe _not_ its modifiers since
>     they can play a part in which keymap to use) and swap out the
>     `down-mouse-2' or similar with `follow-link'.
>
> What does "swap out" mean here?

Replace it (actually, make a copy and replace the `down-mouse-1'
symbol in the copy with `follow-link').


-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2006-09-12 10:04 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-10  9:34 longlines-mode doesn't seem to work with some non-english text Miles Bader
2006-02-11  4:35 ` Chong Yidong
2006-02-13  0:32   ` Kevin Ryde
2006-09-09 15:08 ` local keymap patch for key-binding Chong Yidong
2006-09-09 15:15   ` David Kastrup
2006-09-09 15:26     ` Chong Yidong
2006-09-10 12:44     ` Chong Yidong
2006-09-10 13:25       ` David Kastrup
2006-09-11  2:36         ` Chong Yidong
2006-09-11  6:25           ` David Kastrup
2006-09-11  7:05           ` David Kastrup
2006-09-11  8:52             ` Kim F. Storm
2006-09-11  9:48               ` David Kastrup
2006-09-11 10:11                 ` David Kastrup
2006-09-11 12:53                   ` Kim F. Storm
2006-09-11 13:04                     ` David Kastrup
2006-09-11 13:07                   ` Chong Yidong
2006-09-11 19:58                 ` Richard Stallman
2006-09-12 10:04                   ` David Kastrup [this message]
2006-09-12 15:21                     ` David Kastrup
2006-09-12 15:39                       ` PCL-CVS's diff and marks (was: local keymap patch for key-binding) Stefan Monnier
2006-09-12 15:42                         ` PCL-CVS's diff and marks David Kastrup
2006-09-12 15:54                           ` Stefan Monnier
2006-09-12 21:45                       ` local keymap patch for key-binding Richard Stallman
2006-09-12 22:23                         ` David Kastrup
2006-09-12 23:44                           ` David Kastrup
2006-09-13  7:45                             ` Kim F. Storm
2006-09-13  8:11                               ` David Kastrup
2006-09-13 11:05                                 ` Kim F. Storm
2006-09-13 11:38                                   ` David Kastrup
2006-09-13 12:23                                     ` Kim F. Storm
2006-09-13 12:32                                       ` David Kastrup
2006-09-13 13:45                                         ` Kim F. Storm
2006-09-13 19:25                                     ` Richard Stallman
2006-09-13 19:49                                       ` David Kastrup
2006-09-13 19:25                                 ` Richard Stallman
2006-09-13 20:02                                   ` David Kastrup
2006-09-13 19:24                           ` Richard Stallman
2006-09-13 15:10                       ` Richard Stallman
2006-09-13 15:25                         ` David Kastrup
2006-09-14  2:34                           ` Richard Stallman
2006-09-14 11:57                             ` David Kastrup
2006-09-14 22:34                               ` David Kastrup
2006-09-14 22:36                                 ` David Kastrup
2006-09-15  3:14                               ` Richard Stallman
2006-09-15  8:20                                 ` David Kastrup
2006-09-15 23:47                               ` David Kastrup
2006-09-16  0:14                                 ` Kim F. Storm
2006-09-16 19:05                                   ` Richard Stallman
2006-09-18 15:43                                     ` David Kastrup
2006-09-18 20:34                                       ` Kim F. Storm
2006-09-18 23:39                                       ` Richard Stallman
2006-09-16 16:41                                 ` Stefan Monnier
2006-09-10 18:52       ` Richard Stallman
2006-09-11  2:39         ` Chong Yidong

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85hczdbdv2.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=storm@cua.dk \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.