emacs-devel
[Top][All Lists]
Advanced

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

Re: generic buffer parsing cache data


From: Stefan Monnier
Subject: Re: generic buffer parsing cache data
Date: Sun, 01 Jul 2007 16:08:58 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>> 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.)

You mean that mode data might benefit from being cached at more regular
intervals because it costs more to compute it?  You might be right, here,
I don't know.

> 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.

I don't think parse-partial-sexp would be involved at all: syntax-ppss would
call the mode-specific code on one side and parse-partial-sexp on the
other.  So the issue of minor modes is orthogonal (tho relevant as well).

IIUC you're not proposing a standard generic cache, but a generic library to
manage one's own cache.  So the caching policy (at what kind of interval to
keep records of it, etc...) can be chosen freely, and also so that it can be
used indifferently by major modes, minor modes, etc...


        Stefan




reply via email to

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