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 16:36:21 +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 1232725020 6249 80.91.229.12 (23 Jan 2009 15:37:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2009 15:37:00 +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 16:38:10 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 1LQO6R-0003A5-Jg for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2009 16:37:51 +0100 Original-Received: from localhost ([127.0.0.1]:60304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQO5A-0006jm-23 for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2009 10:36:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQO54-0006iB-RR for emacs-devel@gnu.org; Fri, 23 Jan 2009 10:36:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQO53-0006hq-FW for emacs-devel@gnu.org; Fri, 23 Jan 2009 10:36:26 -0500 Original-Received: from [199.232.76.173] (port=53565 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQO53-0006hn-8X for emacs-devel@gnu.org; Fri, 23 Jan 2009 10:36:25 -0500 Original-Received: from mail-ew0-f20.google.com ([209.85.219.20]:48394) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQO52-0002tZ-Dy for emacs-devel@gnu.org; Fri, 23 Jan 2009 10:36:24 -0500 Original-Received: by ewy13 with SMTP id 13so3999225ewy.18 for ; Fri, 23 Jan 2009 07:36:22 -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=XC0gGRLeeWepETlZpnp22JlWuSw/BV0yD/rSDCjwEN0=; b=AJ9Xnb6K0kygfa+rMStbKfWJZI0QJvncLQrVRFGM+AuLUtRFNnnjRGFl2uET7ZIr6j FpAM9vR5r361jWlIODok8v1Jl8yYVOoD2mJ5w+gcHzjKpUrp8sovMtjDTK0Ds+x+2NP1 LDo+ukuOFaPS7AeZWyP2PNlb2Lbqt3C1fcBOg= 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=OjaRvGNmVAa7I3WVr/FwahGmfv+d3zzt4H0QkGwQ6zgLhCxFbclPFyF6ttvYtCkOKx 8ZnbDKYAc3JE0wdG7LReR02Vy0hdmYkG1zh1uv6zRbF/U6XRyRL+W57gji7lJnKfroI/ XGgUNNR7IWnMN2S+X7oZ641YAjhoanYYiDV6k= Original-Received: by 10.86.68.2 with SMTP id q2mr1174248fga.3.1232724982016; Fri, 23 Jan 2009 07:36:22 -0800 (PST) In-Reply-To: <20090123154150.GD3056@muc.de> 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:108151 Archived-At: 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