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: Thu, 11 Sep 2008 09:35:16 +0200 Message-ID: <87k5djjft7.fsf@thinkpad.tsdh.de> References: <87y72079mg.fsf@thinkpad.tsdh.de> <87ljy012g7.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221118741 12103 80.91.229.12 (11 Sep 2008 07:39:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2008 07:39:01 +0000 (UTC) Cc: Sean O'Rourke , emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 11 09:39:57 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 1KdglA-00047g-GD for ged-emacs-devel@m.gmane.org; Thu, 11 Sep 2008 09:38:36 +0200 Original-Received: from localhost ([127.0.0.1]:43676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdgkA-0003kO-6B for ged-emacs-devel@m.gmane.org; Thu, 11 Sep 2008 03:37:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kdgk6-0003kJ-RB for emacs-devel@gnu.org; Thu, 11 Sep 2008 03:37:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kdgk5-0003k3-Bu for emacs-devel@gnu.org; Thu, 11 Sep 2008 03:37:30 -0400 Original-Received: from [199.232.76.173] (port=52678 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kdgk5-0003k0-9J for emacs-devel@gnu.org; Thu, 11 Sep 2008 03:37:29 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:23752) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kdgjy-0003Xc-UF; Thu, 11 Sep 2008 03:37:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 2EE54789405F; Thu, 11 Sep 2008 09:37:22 +0200 (CEST) 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 08779-07; Thu, 11 Sep 2008 09:37:19 +0200 (CEST) X-CHKRCPT: Envelopesender vrfy tassilo@member.fsf.org Original-Received: from thinkpad.tsdh.de (dhcp188.uni-koblenz.de [141.26.71.188]) by deliver.uni-koblenz.de (Postfix) with ESMTP id B71907897859; Thu, 11 Sep 2008 09:37:19 +0200 (CEST) Mail-Copies-To: never Mail-Followup-To: Miles Bader , Sean O'Rourke , emacs-devel@gnu.org In-Reply-To: <87ljy012g7.fsf@catnip.gol.com> (Miles Bader's message of "Wed, 10 Sep 2008 23:48:56 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Virus-Scanned: amavisd-new at uni-koblenz.de X-detected-kernel: by monty-python.gnu.org: 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:103799 Archived-At: Miles Bader writes: Hi Miles, > Emacs does have keymap properties... Hey, nice feature. I didn't know it till now. But how to I [re]set this property in a good fashion? Currently I think hooking into after-change-function would be TRTD. But maybe there's a better way, like telling the font-locking facility to put keymap foo-map onto all chars which get face foo-face. In most cases where I want to have context sensitivity point is on a special face anyway. Ah, I think I have found it: ,----[ (info "(elisp)Search-based Fontification") ] | However, FACESPEC can also evaluate to a list of this form: | | (face FACE PROP1 VAL1 PROP2 VAL2...) `---- So at least it seems possible. But the font-locking mechanisms are a bit hairy. Probably we could add a simple function for hooking into it; something like (define-context-keymap ) Bye, Tassilo