From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: customizing key definitions with Customize Date: Mon, 12 May 2008 00:02:56 +0200 Message-ID: <48276D10.6070701@gmail.com> References: <000301c8b39e$ded16a50$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1210543401 20449 80.91.229.12 (11 May 2008 22:03:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2008 22:03:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 12 00:03:58 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JvJe9-00049m-Q4 for ged-emacs-devel@m.gmane.org; Mon, 12 May 2008 00:03:58 +0200 Original-Received: from localhost ([127.0.0.1]:47236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvJdR-0007Kc-7T for ged-emacs-devel@m.gmane.org; Sun, 11 May 2008 18:03:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvJdN-0007KX-Je for emacs-devel@gnu.org; Sun, 11 May 2008 18:03:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvJdM-0007KL-AE for emacs-devel@gnu.org; Sun, 11 May 2008 18:03:09 -0400 Original-Received: from [199.232.76.173] (port=49931 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvJdM-0007KI-6j for emacs-devel@gnu.org; Sun, 11 May 2008 18:03:08 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:54429) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JvJdL-0000sf-NU for emacs-devel@gnu.org; Sun, 11 May 2008 18:03:08 -0400 Original-Received: from c83-254-150-27.bredband.comhem.se ([83.254.150.27]:61637 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1JvJdJ-0003FN-5x; Mon, 12 May 2008 00:03:06 +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 In-Reply-To: <000301c8b39e$ded16a50$0200a8c0@us.oracle.com> X-Antivirus: avast! (VPS 080511-0, 2008-05-11), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.150.27 X-Scan-Result: No virus found in message 1JvJdJ-0003FN-5x. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1JvJdJ-0003FN-5x 1efcc485a4e9e0ad4ad0b7c3fab7a129 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96984 Archived-At: 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?