[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generic buffer parsing cache data
From: |
Paul Pogonyshev |
Subject: |
Re: generic buffer parsing cache data |
Date: |
Sun, 1 Jul 2007 16:49:32 +0300 |
User-agent: |
KMail/1.7.2 |
Stefan Monnier wrote:
> >> > I propose that each point position could have "cached parsing data".
> >> > This would be an alist indexed with cache data identifier.
> >> Have you experimented with `syntax-ppss'?
> > I propose to add something generic. For instance, Python mode needs to
> > know indentation level of blocks. It seems that `syntax-ppss` doesn't
> > return it at all. And adding everything that might ever be needed by
> > some XYZ mode seems counter-productive and complicates an already complex
> > function and its return value.
>
> 100% agreement.
>
> This said, I think it might make sense to combine the two so that
> syntax-ppss returns not just the parse-partial-sexp state but also some
> mode-specific data. At least it's been in my TODO list for a while now.
That would be nice, but I see one possible non-trivial problem here. I'm
not sure that `parse-partial-sexp' stores cached data where it is most
logical for the current mode. So it might lead to worse cache performance,
because `parse-partial-sexp' might choose to store data in more sparse
positions in a buffer than its mode would prefer. (However, I might be
wrong, there can be a way to influent this.)
Also, relying on `parse-partial-sexp' makes caching impossible or very
difficult for minor modes, because they don't generally have a say in
determining buffer syntax.
Paul
Re: generic buffer parsing cache data, Stefan Monnier, 2007/07/01
Re: generic buffer parsing cache data, Richard Stallman, 2007/07/01
Re: generic buffer parsing cache data, Richard Stallman, 2007/07/01