From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Customizing key bindings Date: Mon, 09 Sep 2002 18:58:21 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200209092258.g89MwMN21012@rum.cs.yale.edu> References: <200208271621.g7RGLNm30516@rum.cs.yale.edu> <874rdfaytt.fsf@pot.cnuce.cnr.it> <5xvg5sh06u.fsf@kfs2.cua.dk> <20020830235528.GA13207@gnu.org> <87ofbji88u.fsf@emacswiki.org> <87sn0scb0b.fsf@emacswiki.org> <87bs7ama8g.fsf@emacswiki.org> <87lm6dkjf8.fsf_-_@emacswiki.org> <871y827r80.fsf@emacswiki.org> <87ptvm6cdy.fsf@emacswiki.org> <87r8g2dbid.fsf@emacswiki.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1031612409 6130 127.0.0.1 (9 Sep 2002 23:00:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 9 Sep 2002 23:00:09 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17oXVm-0001ad-00 for ; Tue, 10 Sep 2002 01:00:06 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17oY5u-00086s-00 for ; Tue, 10 Sep 2002 01:37:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17oXVn-0005n8-00; Mon, 09 Sep 2002 19:00:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17oXU9-0005m6-00 for emacs-devel@gnu.org; Mon, 09 Sep 2002 18:58:25 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17oXU7-0005lu-00 for emacs-devel@gnu.org; Mon, 09 Sep 2002 18:58:25 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17oXU7-0005lq-00 for emacs-devel@gnu.org; Mon, 09 Sep 2002 18:58:23 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g89MwMN21012; Mon, 9 Sep 2002 18:58:22 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Alex Schroeder Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:7772 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:7772 > (defun custom-add-key (sym key def) > "Add KEY to the keymap stored in SYM with definition DEF. > The shadowed binding is stored, if none has been stored before. The > shadowed bindings are stored in the custom-bindings-shadow property." > (let* ((map (symbol-value sym)) > (old-binding (lookup-key map key)) Note that (progn (define-key map key '(menu-item "foo" a)) (lookup-key map key)) => a This should not be too harmful in practice, tho. Stefan