emacs-devel
[Top][All Lists]
Advanced

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

Re: Problems with syntax-ppss


From: Alan Mackenzie
Subject: Re: Problems with syntax-ppss
Date: Sun, 6 Apr 2008 14:07:31 +0000
User-agent: Mutt/1.5.9i

Hi, Stefan,

On Sat, Apr 05, 2008 at 02:37:39PM -0400, Stefan Monnier wrote:
> >> >I strongly recommend to always call syntax-ppss in a widened
> >> >buffer.
> >> ... and with match-data saved.

> > Er, your replies don't exactly radiate an aura of confidence about
> > syntax-ppss.  ;-(

> > I think you (Stefan) 're saying that the function isn't 100% defined
> > for a narrowed buffer.

> Indeed.

That's not good.

> > Will calling s-ppss on a narrowed buffer corrupt the cache at all,
> > for example?

> Yes it can.  Similarly the cache does not keep track of the
> syntax-table so if you switch syntax-table between calls you may get
> unexpected results.

That's also not good.

Would it not be a good idea to (i) redefine syntax-ppss as calculating
the syntax from BOB (as opposed to (point-min)); (ii) have several
caches, each associated with a particular syntax table (how many modes
are going to use more than 2 or, perhaps, 3?); (iii) put a
`save-match-data' round the function?

[ Stuff about performance read and appreciated. ]

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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