emacs-devel
[Top][All Lists]
Advanced

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

Re: Looking up key myself


From: Miles Bader
Subject: Re: Looking up key myself
Date: Tue, 11 Apr 2006 14:00:29 +0900

"Herbert Euler" <address@hidden> 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 via email to

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