From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Is there a "selective setq locator/highlighter" anywhere? Date: Fri, 23 Jan 2009 17:12:05 +0100 Message-ID: References: <20090122135425.GA3719@muc.de> <20090123154150.GD3056@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232727199 14556 80.91.229.12 (23 Jan 2009 16:13:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2009 16:13:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 23 17:14:32 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 1LQOft-0000XG-BJ for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2009 17:14:29 +0100 Original-Received: from localhost ([127.0.0.1]:43602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQOeb-0007Zw-A3 for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2009 11:13:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQOdd-0006bJ-Px for emacs-devel@gnu.org; Fri, 23 Jan 2009 11:12:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQOdb-0006Z9-UG for emacs-devel@gnu.org; Fri, 23 Jan 2009 11:12:09 -0500 Original-Received: from [199.232.76.173] (port=36130 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQOdb-0006Yv-NO for emacs-devel@gnu.org; Fri, 23 Jan 2009 11:12:07 -0500 Original-Received: from mail-ew0-f20.google.com ([209.85.219.20]:54826) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQOdb-0007LF-6B for emacs-devel@gnu.org; Fri, 23 Jan 2009 11:12:07 -0500 Original-Received: by ewy13 with SMTP id 13so4047153ewy.18 for ; Fri, 23 Jan 2009 08:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dWC0gWlqLeIxnuxVm7naWVQbp9A1v4inXRSTqGM63w8=; b=XAZp5BaMlhH7qTAZF6PVCgZKM1TmLKg7y06t3wBazuYUj6uhZr9lCOhUa5iC612k/x QRuayJH1OHt0+C7OdPwfxaxSNyJt4dZoQ83L0U7pPrEjbTa2uS9POJdedwbpM9R6YRl8 VZ4weu+cV6xrMEjAJiLsk5svXNr1bCgqN4K/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MDr+FC+TeZ2K5hUEnooKEUHC7pa7FQnOFdDo4bEFcPiCBMOpgop3BElZ81zG0F7721 6pD/dmHIXDPah3tDEOvUscINwPqp3ON93tyYM6AZDoMnV7NJmUNWyyHKq3A0mmCePjpD NcyUWX7u2vq5cN3FadQYUA7ktFyUE5SEuFKtc= Original-Received: by 10.86.84.5 with SMTP id h5mr66135fgb.59.1232727125851; Fri, 23 Jan 2009 08:12:05 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:108154 Archived-At: On Fri, Jan 23, 2009 at 4:36 PM, Lennart Borgman wrote: > On Fri, Jan 23, 2009 at 4:41 PM, Alan Mackenzie wrote: >> On Thu, Jan 22, 2009 at 02:44:11PM +0100, Lennart Borgman wrote: >>> On Thu, Jan 22, 2009 at 2:54 PM, Alan Mackenzie wrote: >>> > Hi, Emacs! >> >> [ .... ] >> >>> > 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)) >> >>> Can't you catch this with a regexp? (And I never understood what the >>> multi setq is good for.) >> >> A regexp will only work in practice, sort of, not in theory. In >> particular, regexps (which are mathematically equivalent to finite state >> machines) can't parse arbitrarily nested structures (for which one needs >> a push-down automaton or suchlike. > > I believe saving state is not needed here. Can't you use something like > > (setq \(\w+ \w+\)*[ \t\n\r]+?c-state-cache Eh, though that does not work of course if the value part is more complicated. You are right, state must be saved here.