|
| From: | Per Abrahamsen |
| Subject: | Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..) |
| Date: | Thu, 05 Sep 2002 11:26:58 +0200 |
| User-agent: | Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8) |
"Stefan Monnier" <monnier+gnu/address@hidden> writes:
>> (defkeymap my-keymap
>> (let ((map (make-sparse-keymap)))
>> (define-key map (read-kbd-macro "<f11>") 'bbdb)
>> map)
>> "Keymap to demonstrate `defkeymap'.")
>
> How about allowing a more declarative form like
>
> (defkeymap my-mode-map
> '(([mouse-1] . foo)
> (([mouse-2] "f" "e" "\C-m") . open-file))
> "Keymap for My mode."
> :group 'foo
> :inherit his-mode-map)
I'd prefer that too, it would be more in line with how the rest of
Customize (custom is a place where you are forced to declare your
stuff). It would probably make more sense to use the read-kbd-macro
format though, as that is what the code use internally, and that is
what it saves to to .emacs. I.e.
(defkeymap my-mode-map
'(("<mouse-1>" foo)
(("<mouse-2> f e C-m". open-file))
"Keymap for My mode."
:group 'foo
:inherit his-mode-map)
| [Prev in Thread] | Current Thread | [Next in Thread] |