From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: supporting mouse-entered, mouse-left Date: Fri, 31 Jul 2009 17:56:41 -0700 Message-ID: <2CD05755045E4C60877DA54CC13E7D9D@us.oracle.com> References: <9c768dc60907310013o7226f1d5w4cde4c54b03eb474@mail.gmail.com> <0C3F67DE39BD414B9E7D825BA8D1F3F4@us.oracle.com> <87zlakdcic.fsf@uwakimon.sk.tsukuba.ac.jp> <8F83745376C049F683731B07431703F7@us.oracle.com> <9c768dc60907311357t63c725c1sa8d90c74514532f4@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249088222 32518 80.91.229.12 (1 Aug 2009 00:57:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Aug 2009 00:57:02 +0000 (UTC) Cc: "'Stephen J. Turnbull'" , emacs-devel@gnu.org To: "'Steve Yegge'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 01 02:56:55 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 1MX2u5-0004qN-5f for ged-emacs-devel@m.gmane.org; Sat, 01 Aug 2009 02:56:53 +0200 Original-Received: from localhost ([127.0.0.1]:57919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MX2u4-0002ym-DW for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 20:56:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MX2u0-0002xq-Cr for emacs-devel@gnu.org; Fri, 31 Jul 2009 20:56:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MX2tv-0002ry-0g for emacs-devel@gnu.org; Fri, 31 Jul 2009 20:56:47 -0400 Original-Received: from [199.232.76.173] (port=44234 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MX2tu-0002rr-Tv for emacs-devel@gnu.org; Fri, 31 Jul 2009 20:56:42 -0400 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:27256) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MX2tu-000433-Bb for emacs-devel@gnu.org; Fri, 31 Jul 2009 20:56:42 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n710uHho032627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 1 Aug 2009 00:56:18 GMT Original-Received: from abhmt006.oracle.com (abhmt006.oracle.com [141.146.116.15]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n710ucw4028766; Sat, 1 Aug 2009 00:56:38 GMT Original-Received: from dradamslap1 (/141.144.98.141) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 31 Jul 2009 17:56:36 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <9c768dc60907311357t63c725c1sa8d90c74514532f4@mail.gmail.com> Thread-Index: AcoSIcFQ06OINu+sSVOTffwgrZmiXQAAGAqg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt006.oracle.com [141.146.116.15] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.4A7392C6.0005:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:113491 Archived-At: 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. Sounds like you need two things: 1. A way to highlight all text that has some property with a given value. 2. A way to know when the mouse is over any such text. For #2 I dunno. Maybe you can put something on `post-command-hook' (or you might need to do mouse-tracking). A function on `post-command-hook' could perhaps check whether the last event was a mouse event, and if so get the mouse position and then the value of the property at that position. That could be costly, but it might get you started. For #1, I just added a command to highlight.el that does that. It should give you something that works while you look for something more appropriate, if it isn't exactly what you want. The new command is `hlt-highlight-property-with-value'. You give it the property and value to highlight. You can give it a list of possible values - if the property has any of them, then the text is highlighted. You can also give it start and end limits, the highlighting face, the highlighting type (overlay or text property or both), and whether the highlighting should be with property `face' or `mouse-face'. All of these args are optional. To test the command: 1. Add a property to some text. For a quick test, you could add property `mouse-face' with value `highlight' (e.g. just as a test) using `C-u M-x hlt-highlight-regexp-region'. 2. Highlight all text that has a given property value. `M-x hlt-highlight-property-with-value'. You are prompted for the property and the value. E.g., enter `mouse-face' for the property and `highlight' for its value. All text (in the region or buffer) that has property `mouse-face' with value `highlight' is highlighted. (See the file for how to unhighlight etc.) http://www.emacswiki.org/emacs/highlight.el HTH.