emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A simple implementation of context-sensitive keys


From: Tassilo Horn
Subject: Re: A simple implementation of context-sensitive keys
Date: Thu, 11 Sep 2008 09:35:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Miles Bader <address@hidden> 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 <mode> <matcher> <map>)

Bye,
Tassilo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]