unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles.bader@necel.com>
Cc: help-gnu-emacs@gnu.org, jared@hpalace.com, emacs-devel@gnu.org
Subject: Re: Looking up key myself
Date: Tue, 11 Apr 2006 14:00:29 +0900	[thread overview]
Message-ID: <buofykkn1ua.fsf@dhapc248.dev.necel.com> (raw)
In-Reply-To: <BAY112-F13CC16FFBDF322855291B2DACD0@phx.gbl> (Herbert Euler's message of "Tue, 11 Apr 2006 12:51:18 +0800")

"Herbert Euler" <herberteuler@hotmail.com> writes:
>>(let ((minor-mode-overriding-map-alist
>>        `((my-mode . ,(make-sparse-keymap)))))
>>   (key-binding "a"))
>>
>>It's much simpler than rewriting key-binding.
>
> But even in this way I need to find old key bindings, and
> skip my minor mode in the finding process.

No, I think his point was that using this method, it _will_ ignore your
bindings during the lookup, because the key-map associated with `my-mode'
inside the let will be empty.

In other words, you (1) use a permanent entry in
`minor-mode-overriding-map-alist' with a non-empty keymap to define your
"normal" minor-mode bindings, and then (2) when you want to lookup the
underlying bindings, you temporarily bind `minor-mode-overriding-map-alist'
as shown above to hide your bindings during the key lookup.

[I've never tried this, so I dunno if it really works, but it looks very
elegant...]

-Miles
-- 
Occam's razor split hairs so well, I bought the whole argument!

  reply	other threads:[~2006-04-11  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-11  3:46 Looking up key myself Herbert Euler
2006-04-11  4:05 ` M Jared Finder
2006-04-11  4:51   ` Herbert Euler
2006-04-11  5:00     ` Miles Bader [this message]
2006-04-11  5:10       ` Herbert Euler
2006-04-11 14:19       ` Stefan Monnier
2006-04-11 14:18   ` Stefan Monnier

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=buofykkn1ua.fsf@dhapc248.dev.necel.com \
    --to=miles.bader@necel.com \
    --cc=emacs-devel@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jared@hpalace.com \
    --cc=miles@gnu.org \
    /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 public inbox

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

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