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: A simple implementation of context-sensitive keys Date: Sat, 13 Sep 2008 11:32:42 +0200 Message-ID: <48CB88BA.4020900@gmail.com> 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> <87wshhpcjr.fsf@thinkpad.tsdh.de> <48CAFF55.5040508@gmail.com> <87prn8fqsx.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 1221298387 4863 80.91.229.12 (13 Sep 2008 09:33:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Sep 2008 09:33:07 +0000 (UTC) To: Tassilo Horn , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 13 11:34:03 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 1KeRVy-0004TS-Nx for ged-emacs-devel@m.gmane.org; Sat, 13 Sep 2008 11:34:03 +0200 Original-Received: from localhost ([127.0.0.1]:34358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeRUy-0003VE-4j for ged-emacs-devel@m.gmane.org; Sat, 13 Sep 2008 05:33:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeRUr-0003V7-E1 for emacs-devel@gnu.org; Sat, 13 Sep 2008 05:32:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeRUo-0003Uv-L3 for emacs-devel@gnu.org; Sat, 13 Sep 2008 05:32:51 -0400 Original-Received: from [199.232.76.173] (port=50409 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeRUo-0003Us-Ek for emacs-devel@gnu.org; Sat, 13 Sep 2008 05:32:50 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]:41244) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeRUn-0004lT-Oe for emacs-devel@gnu.org; Sat, 13 Sep 2008 05:32:50 -0400 Original-Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:60335 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KeRUm-000792-6c; Sat, 13 Sep 2008 11:32:48 +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: <87prn8fqsx.fsf@thinkpad.tsdh.de> X-Enigmail-Version: 0.95.7 X-Antivirus: avast! (VPS 080912-1, 2008-09-12), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KeRUm-000792-6c. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1KeRUm-000792-6c 3e04b39fd95cba1c530cdf50496adedf X-detected-kernel: by monty-python.gnu.org: GNU/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:103867 Archived-At: Tassilo Horn wrote: > "Lennart Borgman (gmail)" writes: > > Hi Lennart, > >>> Here's a q&d implementation of what I thought should do the trick. >>> It works for me, although only very briefly tested. >>> >>> --8<---------------cut here---------------start------------->8--- >>> (defun find-key-commands (key) >>> (let (list) >>> (when overriding-terminal-local-map >> >> Yes, the structure of the key binding search must be mirrored in the >> routine. But the problem I tried to solve was rather to find the >> keymap variable names. > > Ok, that's true. You either have the keymap variable name or the mode > name. In most cases appending "-map" to the mode name makes the keymap > name. And even it that fails for some modes, I thing something like > > TAB ist bound to `do-foo' in `foo-mode'. > > is not too bad. Yes, it might be good to combine the output with this information when it looks reliable. >> You do not have those names available anywhere really. You have to >> guess. > > Maybe an adapted version of `apropos-value' might do the trick. As it's > now it's much too slow Did you try describe-key-and-map-briefly? >> But combining the mirrored structure with the routine that guesses the >> keymap variable name would be the best I think. > > Yeah, something like that. > > Bye, > Tassilo