From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: Is there a "selective setq locator/highlighter" anywhere? Date: Thu, 22 Jan 2009 10:06:28 -0800 (PST) Message-ID: <42394.128.165.123.18.1232647588.squirrel@webmail.lanl.gov> References: <20090122135425.GA3719@muc.de> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1232647611 8784 80.91.229.12 (22 Jan 2009 18:06:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2009 18:06:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Alan Mackenzie" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 22 19:08:02 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 1LQ3yD-0002fr-Kd for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2009 19:08:02 +0100 Original-Received: from localhost ([127.0.0.1]:58960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQ3wu-0007iu-4E for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2009 13:06:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQ3wp-0007ia-Ta for emacs-devel@gnu.org; Thu, 22 Jan 2009 13:06:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQ3wm-0007gm-Mz for emacs-devel@gnu.org; Thu, 22 Jan 2009 13:06:34 -0500 Original-Received: from [199.232.76.173] (port=54645 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQ3wm-0007gf-JF for emacs-devel@gnu.org; Thu, 22 Jan 2009 13:06:32 -0500 Original-Received: from mail.lanl.gov ([204.121.3.25]:60965 helo=proofpoint1.lanl.gov) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQ3wl-00042q-VN for emacs-devel@gnu.org; Thu, 22 Jan 2009 13:06:32 -0500 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint1.lanl.gov (8.14.3/8.14.3) with ESMTP id n0MI6SWq007507; Thu, 22 Jan 2009 11:06:28 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 51EA015DAF3A; Thu, 22 Jan 2009 11:06:28 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 3E52015DAF1C; Thu, 22 Jan 2009 11:06:28 -0700 (MST) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id 3A72A1518033; Thu, 22 Jan 2009 11:06:28 -0700 (MST) Original-Received: from 128.165.123.18 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Thu, 22 Jan 2009 10:06:28 -0800 (PST) In-Reply-To: <20090122135425.GA3719@muc.de> User-Agent: SquirrelMail/1.4.8-5.2.lanl1 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.7400:2.4.4, 1.2.40, 4.0.166 definitions=2009-01-22_13:2009-01-21, 2009-01-22, 2009-01-22 signatures=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:108101 Archived-At: > I would like a tool which would highlight these: > > (setq foo bar > c-state-cache (cdr c-state-cache)) > (setcar c-state-cache (caar c-state-cache)) > > , but not this: > > (setq old-cache c-state-cache) Not a polished tool, by any means, but can't you just do ;; Handles set, setq, setcar, setcdr (save-excursion (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward "(set\\(q?\\|c[ad]r\\)\\>" nil t) (skip-syntax-forward "^ >") (while (progn (skip-syntax-forward " >'p") (when (looking-at "c-state-cache") (let ((o (make-overlay (point) (match-end 0) nil t))) (overlay-put o 'face 'highlight) (overlay-put o 'c-state-cache t) (overlay-put o 'evaporate t))) (ignore-errors (forward-sexp 2) t)))))) ;; Putting the (meaningless) "c-state-cache" property ;; on the overlay means we can remove them easily: (remove-overlays nil nil 'c-state-cache t) Wrap in defuns/commands as desired. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.