From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel,gmane.emacs.help Subject: Re: Looking up key myself Date: Tue, 11 Apr 2006 14:00:29 +0900 Message-ID: References: Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144731676 32105 80.91.229.2 (11 Apr 2006 05:01:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2006 05:01:16 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, jared@hpalace.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 11 07:01:13 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FTB00-0005Wu-NC for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 07:01:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTB00-0006AV-9V for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 01:01:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FTAzZ-000699-65 for emacs-devel@gnu.org; Tue, 11 Apr 2006 01:00:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FTAzU-00066P-DQ for emacs-devel@gnu.org; Tue, 11 Apr 2006 01:00:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTAzS-00065p-JB; Tue, 11 Apr 2006 01:00:34 -0400 Original-Received: from [203.180.232.81] (helo=mgate01.necel.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FTB4C-0003yO-5O; Tue, 11 Apr 2006 01:05:28 -0400 Original-Received: from relay31.aps.necel.com (relay31 [10.29.19.54]) by mgate01.necel.com (8.13.6/8.13.1) with ESMTP id k3B3piG6002436; Tue, 11 Apr 2006 14:00:29 +0900 (JST) Original-Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay31.aps.necel.com with ESMTP; Tue, 11 Apr 2006 14:00:29 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.97.235] [10.114.97.235]) by relay11.aps.necel.com with ESMTP; Tue, 11 Apr 2006 14:00:29 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 493C544A; Tue, 11 Apr 2006 14:00:29 +0900 (JST) Original-To: "Herbert Euler" System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: (Herbert Euler's message of "Tue, 11 Apr 2006 12:51:18 +0800") Original-Lines: 26 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:52634 gmane.emacs.help:34296 Archived-At: "Herbert Euler" writes: >>(let ((minor-mode-overriding-map-alist >> `((my-mode . ,(make-sparse-keymap))))) >> (key-binding "a")) >> >>It's much simpler than rewriting key-binding. > > But even in this way I need to find old key bindings, and > skip my minor mode in the finding process. No, I think his point was that using this method, it _will_ ignore your bindings during the lookup, because the key-map associated with `my-mode' inside the let will be empty. In other words, you (1) use a permanent entry in `minor-mode-overriding-map-alist' with a non-empty keymap to define your "normal" minor-mode bindings, and then (2) when you want to lookup the underlying bindings, you temporarily bind `minor-mode-overriding-map-alist' as shown above to hide your bindings during the key lookup. [I've never tried this, so I dunno if it really works, but it looks very elegant...] -Miles -- Occam's razor split hairs so well, I bought the whole argument!