help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to build a conditional keymap?


From: rejeep
Subject: Re: How to build a conditional keymap?
Date: Sat, 6 Dec 2008 01:16:33 -0800 (PST)
User-agent: G2/1.0

On Dec 6, 7:43 am, Ian Eure <i...@digg.com> wrote:
> On Dec 5, 2008, at 2:06 AM, rejeep wrote:
>
> > Hi,
>
> > I'm trying to create a minor mode. But I get stuck on the mode-map.
> > I'm trying to set the keybindings depending on some condition.
>
> > But this will not work. So basically my question is: How do I best
> > build a conditional keymap?
>
> What's wrong with:
>
> (define-key mm-minor-mode-map "\C-m" 'mm-b))
> (defun mm-b ()
>    (interactive)
>    (and (< 3 -1) (print "b")))
>
>   - Ian

That will still bind C-m to mm-b. The condition is to decide whether
or not the binding should be set. So if the condition is true I want C-
m to be set to mm-b. But if it's false I don't want C-m to change.


Sorry if I was unclear about that!


reply via email to

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