From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: A simple implementation of context-sensitive keys Date: Fri, 12 Sep 2008 11:47:07 +0200 Message-ID: <87d4j9r90k.fsf@thinkpad.tsdh.de> References: <87y72079mg.fsf@thinkpad.tsdh.de> <87d4jbg62j.fsf@thinkpad.tsdh.de> <48C92024.6080804@gmail.com> <48C921CB.3010700@gmail.com> <87hc8miwy0.fsf@thinkpad.tsdh.de> <48C981C6.9030201@gmail.com> <87abed97gl.fsf@thinkpad.tsdh.de> <48CA29A7.1040501@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221212984 28117 80.91.229.12 (12 Sep 2008 09:49:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2008 09:49:44 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 12 11:50:40 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 1Ke5IU-0003d1-Qf for ged-emacs-devel@m.gmane.org; Fri, 12 Sep 2008 11:50:39 +0200 Original-Received: from localhost ([127.0.0.1]:57243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ke5HP-0008TB-4p for ged-emacs-devel@m.gmane.org; Fri, 12 Sep 2008 05:49:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ke5HH-0008Se-Ho for emacs-devel@gnu.org; Fri, 12 Sep 2008 05:49:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ke5HF-0008SI-Hy for emacs-devel@gnu.org; Fri, 12 Sep 2008 05:49:22 -0400 Original-Received: from [199.232.76.173] (port=54138 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ke5HF-0008Rp-20 for emacs-devel@gnu.org; Fri, 12 Sep 2008 05:49:21 -0400 Original-Received: from out1.smtp.messagingengine.com ([66.111.4.25]:45333) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ke5HA-0000AA-Gr for emacs-devel@gnu.org; Fri, 12 Sep 2008 05:49:17 -0400 Original-Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 6ACA6160AED; Fri, 12 Sep 2008 05:49:15 -0400 (EDT) Original-Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 12 Sep 2008 05:49:15 -0400 X-Sasl-enc: 5agnSMymE6M5Ksn2kLpquf1O86Hg6NwAiB3kCGLLNnmW 1221212954 Original-Received: from thinkpad.tsdh.de (p54AF2367.dip0.t-ipconnect.de [84.175.35.103]) by mail.messagingengine.com (Postfix) with ESMTPA id D13861822F; Fri, 12 Sep 2008 05:49:13 -0400 (EDT) In-Reply-To: <48CA29A7.1040501@gmail.com> (Lennart Borgman's message of "Fri, 12 Sep 2008 10:34:47 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Mail-Copies-To: never Mail-Followup-To: "Lennart Borgman \(gmail\)" , Stefan Monnier , emacs-devel@gnu.org X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:103843 Archived-At: "Lennart Borgman (gmail)" writes: Hi Lennart, >> I think you could reimplement the key lookup procedure you referenced >> and don't stop searching when KEY is found. Then you know the name >> of the map. > > What do you mean? Please write the code and show it. Sorry, no time to write the code now. What I mean is that in (info "(elisp)Searching Keymaps") there's the pseudocode how emacs finds the command for a key. Now you can surrogate "FIND-IN" with lookup-key and see if the key is bound in the map. In that code you know the map or at least the mode, cause you either have the variable directly (like overriding-local-map) or you walk an alist of the form ((mode-name . keymap)...) in the case of FIND-IN-ANY. Bye, Tassilo