From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Yegge Newsgroups: gmane.emacs.devel Subject: Re: supporting mouse-entered, mouse-left Date: Fri, 31 Jul 2009 08:48:30 -0700 Message-ID: <9c768dc60907310848k73ea7284g91ebdc15cd35ae60@mail.gmail.com> References: <9c768dc60907310013o7226f1d5w4cde4c54b03eb474@mail.gmail.com> <0C3F67DE39BD414B9E7D825BA8D1F3F4@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001636163df9179df00470025a4d X-Trace: ger.gmane.org 1249071750 28300 80.91.229.12 (31 Jul 2009 20:22:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2009 20:22:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 31 22:22:23 2009 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 1MWycO-00036J-AS for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 22:22:20 +0200 Original-Received: from localhost ([127.0.0.1]:43448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWycN-0001Y1-Ba for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 16:22:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWuLa-0003XR-CC for emacs-devel@gnu.org; Fri, 31 Jul 2009 11:48:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWuLV-0003Ig-5t for emacs-devel@gnu.org; Fri, 31 Jul 2009 11:48:41 -0400 Original-Received: from [199.232.76.173] (port=55225 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWuLV-0003I8-0t for emacs-devel@gnu.org; Fri, 31 Jul 2009 11:48:37 -0400 Original-Received: from smtp-out.google.com ([216.239.45.13]:45030) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWuLU-0002qL-Dr for emacs-devel@gnu.org; Fri, 31 Jul 2009 11:48:36 -0400 Original-Received: from spaceape7.eur.corp.google.com (spaceape7.eur.corp.google.com [172.28.16.141]) by smtp-out.google.com with ESMTP id n6VFmX3s032635 for ; Fri, 31 Jul 2009 08:48:34 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1249055314; bh=PtfH0wc0c281u9B4YQquWI3zk6E=; h=DomainKey-Signature:MIME-Version:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:X-System-Of-Record; b=F TWskHtZoHZY25UkEQPDbyoi91W545wUkb2Bg6GciRvAXQGEinTV1zdL/iBQVV+kLGCV xmgSMmhXDfU6hxlRKw== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:x-system-of-record; b=d6GasAfAJtrZSYm5S9N6fSzuhYSM3l0yuXudonJhFwznVy9aaNuN39phh0yiItfD8 TmCno+H8CVIgvCxaiGMcw== Original-Received: from ywh7 (ywh7.prod.google.com [10.192.8.7]) by spaceape7.eur.corp.google.com with ESMTP id n6VFlXF0012442 for ; Fri, 31 Jul 2009 08:48:31 -0700 Original-Received: by ywh7 with SMTP id 7so1815919ywh.21 for ; Fri, 31 Jul 2009 08:48:30 -0700 (PDT) Original-Received: by 10.90.32.9 with SMTP id f9mr2028216agf.102.1249055310583; Fri, 31 Jul 2009 08:48:30 -0700 (PDT) In-Reply-To: <0C3F67DE39BD414B9E7D825BA8D1F3F4@us.oracle.com> X-System-Of-Record: true X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Fri, 31 Jul 2009 16:19:41 -0400 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:113482 Archived-At: --001636163df9179df00470025a4d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Fri, Jul 31, 2009 at 8:38 AM, Drew Adams 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 --001636163df9179df00470025a4d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Jul 31, 2009 at 8:38 AM, Drew Adams <drew.adams@oracle.com> wrot= e:
=A0 =A0 =A0 =A0I would like to highlight= certain identifiers (such as all uses
=A0 =A0 =A0 =A0of a particular local variable in a function) simultaneousl= y
=A0 =A0 =A0 =A0when the mouse enters any of them.

=A0 =A0 =A0 =A0I've scoured the documentation, and I don't see a w= ay to
=A0 =A0 =A0 =A0accomplish this feat.

=A0 =A0 =A0 =A0Would it be reasonable to add mouse-entered and mouse-left<= br> =A0 =A0 =A0 =A0properties analogous to point-entered and point-left?

=A0 =A0 =A0 =A0Alternately (or in addition), it might be nice to have text=
=A0 =A0 =A0 =A0properties analogous to the mouseenter, mouseleave and
=A0 =A0 =A0 =A0possibly mouseover standard browser events, which would
=A0 =A0 =A0 =A0fire at the granularity of pixels rather than characters.
Maybe I'm misunderstanding, but if you mean highlight the t= ext whenever the
mouse is over it, you can do that using text property `mouse-face'. (Th= at has
character granularity however.)

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

AFAIK, font-lock cannot be used for this, since it always uses the `face= 9; 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=A0sorry=A0if=A0I=A0was=A0unclear.= =A0=A0Let=A0me=A0give=A0an=A0example.=A0=A0In=A0this=A0sentence:
=
"One=A0flew=A0east,=A0one=A0flew=A0west,=A0and=A0one=A0= flew=A0over=A0the=A0cuckoo's=A0nest."=A0

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

`mouse-face' i= s not powerful enough to accomplish this.

-steve

--001636163df9179df00470025a4d--