emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a "selective setq locator/highlighter" anywhere?


From: Lennart Borgman
Subject: Re: Is there a "selective setq locator/highlighter" anywhere?
Date: Fri, 23 Jan 2009 16:36:21 +0100

On Fri, Jan 23, 2009 at 4:41 PM, Alan Mackenzie <address@hidden> 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 <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]