[Top][All Lists]
[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 17:12:05 +0100 |
On Fri, Jan 23, 2009 at 4:36 PM, Lennart Borgman
<address@hidden> wrote:
> 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
Eh, though that does not work of course if the value part is more
complicated. You are right, state must be saved here.