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 13:57:58 -0700 Message-ID: <9c768dc60907311357t63c725c1sa8d90c74514532f4@mail.gmail.com> References: <9c768dc60907310013o7226f1d5w4cde4c54b03eb474@mail.gmail.com> <0C3F67DE39BD414B9E7D825BA8D1F3F4@us.oracle.com> <87zlakdcic.fsf@uwakimon.sk.tsukuba.ac.jp> <8F83745376C049F683731B07431703F7@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016361e8856da53d6047006ac79 X-Trace: ger.gmane.org 1249083023 23165 80.91.229.12 (31 Jul 2009 23:30:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2009 23:30:23 +0000 (UTC) Cc: "Stephen J. Turnbull" , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 01 01:30:16 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 1MX1YF-0000WQ-8B for ged-emacs-devel@m.gmane.org; Sat, 01 Aug 2009 01:30:15 +0200 Original-Received: from localhost ([127.0.0.1]:45829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MX1YE-0007ZZ-DN for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 19:30:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWzB3-00014c-TY for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:58:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWzAz-000133-JS for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:58:09 -0400 Original-Received: from [199.232.76.173] (port=57924 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWzAz-00012q-EP for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:58:05 -0400 Original-Received: from smtp-out.google.com ([216.239.45.13]:23790) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWzAy-00009q-BQ for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:58:05 -0400 Original-Received: from spaceape9.eur.corp.google.com (spaceape9.eur.corp.google.com [172.28.16.143]) by smtp-out.google.com with ESMTP id n6VKw2fZ024349 for ; Fri, 31 Jul 2009 13:58:02 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1249073882; bh=+Jk2jqA6G1S05m+8zIpbYWwaukQ=; h=DomainKey-Signature:MIME-Version:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:X-System-Of-Record; b=G w6ZkGYUCjhFvJ4szAaoAJtiOtYnoMTR2wnKGTPPdKPXi8NETC4klFwKgbyhTGkQEa45 1Zw1xMsGP+p2KMrMbA== 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=MXDqYCp9t4diA9A9dfPiC5fEcRB54WGCJMXfkwHhY52TPzgji43uxkZEdqh9cV7ov sXbP+xARTsheHEMko9YJA== Original-Received: from gxk22 (gxk22.prod.google.com [10.202.11.22]) by spaceape9.eur.corp.google.com with ESMTP id n6VKvM6P002534 for ; Fri, 31 Jul 2009 13:57:59 -0700 Original-Received: by gxk22 with SMTP id 22so4604474gxk.0 for ; Fri, 31 Jul 2009 13:57:59 -0700 (PDT) Original-Received: by 10.90.116.15 with SMTP id o15mr2259339agc.67.1249073878946; Fri, 31 Jul 2009 13:57:58 -0700 (PDT) In-Reply-To: <8F83745376C049F683731B07431703F7@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 19:30:08 -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:113489 Archived-At: --0016361e8856da53d6047006ac79 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Fri, Jul 31, 2009 at 1:23 PM, Drew Adams wrote: > FWIW, you can use command `hlt-highlight-regexp-region' with a prefix arg > to put > `mouse-face' on all regexp matches (in the region or buffer). It can use > either > overlays or text properties. The command is here: > http://www.emacswiki.org/emacs/highlight.el. > > What's still missing for the requested feature is the ability to show _all_ > `mouse-face' text whenever you mouse-over any such text. > Thanks, but I'm not looking for a one-off command to run, and regular expressions are not sufficient for my needs here. This is intended to be a feature of js2-mode, which I checked in to the repository a few days ago. It is a major mode for editing JavaScript code. It generates a full parse tree for the buffer, so it knows exactly where all local variables and function parameters are declared and referenced. The mode decorates the source with various text properties to facilitate navigation, outlining, folding, etc. My goal is to link together all the references to each local variable, so they light up when you mouse over any of them. I can't use track-mouse, or at least I don't think I can, since this feature needs to trigger automatically as you move the mouse (from the idle loop). If there were a way to be notified that the mouse has started moving, then I could use track-mouse, albeit with a huge pile of code. But it would likely be much less work to implement this in C and offer a higher-level interface at the lisp level. I'll take a look at implementing it when I get some time. I just wanted to vet the idea with the list to make sure I wouldn't be wasting my time. -steve --0016361e8856da53d6047006ac79 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Jul 31, 2009 at 1:23 PM, Drew Adams <drew.adams@oracle.com> wrot= e:
FWIW, you can use command `hlt-highlight-regexp-region' with a prefix a= rg to put
`mouse-face' on all regexp matches (in the region or buffer). It can us= e either
overlays or text properties. The command is here:
h= ttp://www.emacswiki.org/emacs/highlight.el.

What's still missing for the requested feature is the ability to show _= all_
`mouse-face' text whenever you mouse-over any such text.

Thanks, but I'm not looking for a one-off command= to run, and
regular expressions are not sufficient for my needs here.
This is intended to be a feature of js2-mode, which I checked in
to the repository a few days ago.=A0 It is a major mode for editing
Java= Script code.=A0 It generates a full parse tree for the buffer, so
it kno= ws exactly where all local variables and function parameters
are declare= d and referenced.

The mode decorates the source with various text properties to
facili= tate navigation, outlining, folding, etc.=A0 My goal is to link
together= all the references to each local variable, so they light
up when you mo= use over any of them.

I can't use track-mouse, or at least I don't think I can, since= this
feature needs to trigger automatically as you move the mouse
(f= rom the idle loop).

If there were a way to be notified that the mous= e has started
moving, then I could use track-mouse, albeit with a huge pile of
code.= =A0 But it would likely be much less work to implement this in
C and off= er a higher-level interface at the lisp level.

I'll take a look = at implementing it when I get some time.=A0 I just
wanted to vet the idea with the list to make sure I wouldn't be
wast= ing my time.

-steve

=A0

--0016361e8856da53d6047006ac79--