On Fri, Jul 31, 2009 at 8:38 AM, Drew Adams <drew.adams@oracle.com> wrote:
       I would like to highlight certain identifiers (such as all uses
       of a particular local variable in a function) simultaneously
       when the mouse enters any of them.

       I've scoured the documentation, and I don't see a way to
       accomplish this feat.

       Would it be reasonable to add mouse-entered and mouse-left
       properties analogous to point-entered and point-left?

       Alternately (or in addition), it might be nice to have text
       properties analogous to the mouseenter, mouseleave and
       possibly mouseover standard browser events, which would
       fire at the granularity of pixels rather than characters.

Maybe I'm misunderstanding, but if you mean highlight the text whenever the
mouse is over it, you can do that using text property `mouse-face'. (That has
character granularity however.)

To have the mouseover highlight appear for certain words etc., you would need to
apply property `mouse-face' to those words.

AFAIK, font-lock cannot be used for this, since it always uses the `face' text
property. (But maybe I'm wrong about that.) It might be an interesting feature
for font-lock to let you specify a different text property to use.


I'm sorry if I was unclear.  Let me give an example.  In this sentence:

"One flew east, one flew west, and one flew over the cuckoo's nest." 

I would like to arrange things in advance so that whenever the mouse is
over any instance of the word "flew", ALL of the instances highlight.

`mouse-face' is not powerful enough to accomplish this.

-steve