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: Wed, 10 Sep 2008 21:21:40 +0200 Message-ID: <87d4jbg62j.fsf@thinkpad.tsdh.de> References: <87y72079mg.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221074653 1277 80.91.229.12 (10 Sep 2008 19:24:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Sep 2008 19:24:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 10 21:25:08 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 1KdVJC-0004nk-2m for ged-emacs-devel@m.gmane.org; Wed, 10 Sep 2008 21:24:58 +0200 Original-Received: from localhost ([127.0.0.1]:57811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdVIB-00046T-Ok for ged-emacs-devel@m.gmane.org; Wed, 10 Sep 2008 15:23:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdVI6-00044D-5a for emacs-devel@gnu.org; Wed, 10 Sep 2008 15:23:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdVI5-00042y-6V for emacs-devel@gnu.org; Wed, 10 Sep 2008 15:23:49 -0400 Original-Received: from [199.232.76.173] (port=37481 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdVI5-00042t-1o for emacs-devel@gnu.org; Wed, 10 Sep 2008 15:23:49 -0400 Original-Received: from out3.smtp.messagingengine.com ([66.111.4.27]:37698) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KdVI4-0008Tm-IA for emacs-devel@gnu.org; Wed, 10 Sep 2008 15:23:48 -0400 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 9D1E215FC25; Wed, 10 Sep 2008 15:23:47 -0400 (EDT) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 10 Sep 2008 15:23:47 -0400 X-Sasl-enc: ktPr4hn9n71yQr78AtFSdyeqFQuFuQNQN55AS/K6hTg0 1221074627 Original-Received: from thinkpad.tsdh.de (p54AF2217.dip0.t-ipconnect.de [84.175.34.23]) by mail.messagingengine.com (Postfix) with ESMTPA id 82D283130D; Wed, 10 Sep 2008 15:23:46 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Wed, 10 Sep 2008 13:49:48 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Mail-Copies-To: never Mail-Followup-To: 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:103778 Archived-At: Stefan Monnier writes: Hi Stefan, > Another way to get a similar result is: > > (define-key '(menu-item "dummy" > :filter (lambda (binding) > (when binding)))) Wow, yet another alternative besides the keymap text property Miles mentioned. > In any case, the main problem with such things (whichever way they're > implemented) is that the rest of Emacs doesn't know and/or expect such > condition bindings, so C-h k gives only partial information, and > similarly where-is doesn't know how to tell the whole story. Sure, so I'd say that in general modes shouldn't use such facilities by default. Which commands should be executed depending on which context is a quite subjective decision anyway. But to have the possibilities right at hand is great, whichever one you use. Bye, Tassilo -- [Emacs] is written in Lisp, which is the only computer language that is beautiful. -- Neal Stephenson, _In the Beginning was the Command Line_