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: Get a command by its keybinding and also respecting key translation Date: Tue, 14 Dec 2010 23:51:21 +0100 Message-ID: <201012142351.21774.tassilo@member.fsf.org> References: <871v5lpkk6.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292367103 16124 80.91.229.12 (14 Dec 2010 22:51:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Dec 2010 22:51:43 +0000 (UTC) Cc: Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 14 23:51:39 2010 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.69) (envelope-from ) id 1PSdic-0001yS-IT for ged-emacs-devel@m.gmane.org; Tue, 14 Dec 2010 23:51:38 +0100 Original-Received: from localhost ([127.0.0.1]:39692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSdic-00077Y-3S for ged-emacs-devel@m.gmane.org; Tue, 14 Dec 2010 17:51:38 -0500 Original-Received: from [140.186.70.92] (port=57516 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSdiT-00072I-EF for emacs-devel@gnu.org; Tue, 14 Dec 2010 17:51:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSdiO-0005f5-FU for emacs-devel@gnu.org; Tue, 14 Dec 2010 17:51:25 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:6048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSdiO-0005ey-Al for emacs-devel@gnu.org; Tue, 14 Dec 2010 17:51:24 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 1AA45780169D; Tue, 14 Dec 2010 23:51:23 +0100 (CET) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 02460-08; Tue, 14 Dec 2010 23:51:22 +0100 (CET) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from thinkpad.localnet (95-88-32-105-dynip.superkabel.de [95.88.32.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTP id 93A437801691; Tue, 14 Dec 2010 23:51:22 +0100 (CET) User-Agent: KMail/1.13.5 (Linux/2.6.37-rc5+; KDE/4.5.4; x86_64; ; ) In-Reply-To: X-Virus-Scanned: amavisd-new at uni-koblenz.de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:133701 Archived-At: On Tuesday 14 December 2010 20:50:43 Stefan Monnier wrote: > > (define-context-key outline-minor-mode-map > > (kbd "") > > th-outline-context-p > > org-cycle) > > You can do it this way: > > (define-key outline-minor-mode-map > (kdb "") > `(menu-item "dummy" org-cycle > :filter ,(lambda (cmd) > (if (th-outline-context-p) cmd)))) Hm, just for educational purposes, could you please explain the backquoting and the comma-substitution of the lambda? I mean, I know that `,' in a backquote triggers evaluation, but since a lambda evals to itself, what's the point in doing so? Thanks! Tassilo