emacs-devel
[Top][All Lists]
Advanced

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

Re: customizing key definitions with Customize


From: Lennart Borgman (gmail)
Subject: Re: customizing key definitions with Customize
Date: Mon, 12 May 2008 00:02:56 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Drew Adams wrote:
Users can customize key definitions by using commands such as `global-set-key'
or by using functions such as `define-key' in their init files. And `kbd' helps
them by letting them use external key descriptions.
It can sometimes be useful to let users use Customize to update key-binding
definitions. The `key-sequence' widget added in Emacs 22 is helpful here, but it
only takes care of the key-sequence part of a binding, not the map part or the
target command part. Also, defining keys can sometimes mean remapping existing
commands instead of providing a key sequence to bind, and the `key-sequence'
widget doesn't apply in that case.

I've been using a key definition widget as a custom type, to let users of a
library use only Customize to customize key bindings, if they want.
The widget uses a `choice' to let you either specify a key sequence to bind or a
command to be remapped. Dunno if this is of general interest, but here is what I
use.

(define-widget 'key-definition 'lazy
  "Key definition.

I like the idea, but can't it be taken one step further: Wouldn't it be nice with a "sparse-keymap widget"? And then of course `customize-sparse-keymap'.

Or have you already done this too, Drew?




reply via email to

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