From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman" Newsgroups: gmane.emacs.devel Subject: Re: A simple implementation of context-sensitive keys Date: Fri, 12 Sep 2008 13:00:38 +0200 Message-ID: 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> <87d4j9r90k.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1221217264 9295 80.91.229.12 (12 Sep 2008 11:01:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2008 11:01:04 +0000 (UTC) To: "Lennart Borgman (gmail)" , "Stefan Monnier" , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 12 13:01:59 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 1Ke6PW-00057A-PZ for ged-emacs-devel@m.gmane.org; Fri, 12 Sep 2008 13:01:59 +0200 Original-Received: from localhost ([127.0.0.1]:60561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ke6OV-0000jH-Qr for ged-emacs-devel@m.gmane.org; Fri, 12 Sep 2008 07:00:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ke6OM-0000fr-0d for emacs-devel@gnu.org; Fri, 12 Sep 2008 07:00:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ke6OH-0000YP-1C for emacs-devel@gnu.org; Fri, 12 Sep 2008 07:00:44 -0400 Original-Received: from [199.232.76.173] (port=40919 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ke6OG-0000Xu-D0 for emacs-devel@gnu.org; Fri, 12 Sep 2008 07:00:40 -0400 Original-Received: from mail-gx0-f12.google.com ([209.85.217.12]:43655) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ke6OF-0005be-Ro for emacs-devel@gnu.org; Fri, 12 Sep 2008 07:00:40 -0400 Original-Received: by gxk5 with SMTP id 5so18512686gxk.18 for ; Fri, 12 Sep 2008 04:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=lp8PqbX7Lbou4gcTYT70vIRCsIpMnqo+27LeAh50Ryk=; b=SJ9UmtX38D6KCKoBSerg9fJejxOBDPHHP/fbZ1WyIVr+gc1mLn/Eq/skoadH0/F37/ jwHEZRAhn2h1lHYBNcWtIkpeQDBIbCjHID4szFxhjieX6NNjE2GshrHOL2fsutKOXoCH 7QeoMi8/c1ncIIRtsKQmeeLHQjHbxIcVqUDbM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=O/7JYC3/D9m0jhyvL2PLioJAEPlYO+QkYU+tfsJP9bqr7bRXxgtgrK2E6RR5TeLdLY DGzRJCw4gbtdoCpbDkzDxjTpZtMZVi2kc5AqPCqCx7A0c2PTGOuEagTkibgB1BaCMsvX 0mH/mvUQ9uhzXCDs9/P49ss2y4x7s8jol4ntk= Original-Received: by 10.86.89.1 with SMTP id m1mr3046052fgb.68.1221217238335; Fri, 12 Sep 2008 04:00:38 -0700 (PDT) Original-Received: by 10.86.65.3 with HTTP; Fri, 12 Sep 2008 04:00:38 -0700 (PDT) In-Reply-To: <87d4j9r90k.fsf@thinkpad.tsdh.de> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:103844 Archived-At: On 9/12/08, Tassilo Horn wrote: > "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. It would be good if that where true, but it is not. You have to take a closer look to understand how this works. I think a good start might be the code I sent before. > Bye, > Tassilo >