unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Paul Pogonyshev <pogonyshev@gmx.net>
Cc: martin rudalics <rudalics@gmx.at>, emacs-devel@gnu.org
Subject: Re: generic buffer parsing cache data
Date: Sun, 01 Jul 2007 16:08:58 -0400	[thread overview]
Message-ID: <jwv7ipjhovh.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <200707011649.32728.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Sun\, 1 Jul 2007 16\:49\:32 +0300")

>> 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	other threads:[~2007-07-01 20:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-30 21:38 generic buffer parsing cache data Paul Pogonyshev
2007-07-01 11:48 ` martin rudalics
2007-07-01 12:16   ` Paul Pogonyshev
2007-07-01 12:38     ` martin rudalics
2007-07-01 13:41       ` Paul Pogonyshev
2007-07-01 15:20         ` martin rudalics
2007-07-01 20:40         ` Richard Stallman
2007-07-01 12:45     ` Thien-Thi Nguyen
2007-07-01 13:10       ` Paul Pogonyshev
2007-07-01 13:16         ` Lennart Borgman (gmail)
2007-07-01 13:43           ` Paul Pogonyshev
2007-07-01 13:28       ` joakim
2007-07-01 12:52     ` Stefan Monnier
2007-07-01 13:49       ` Paul Pogonyshev
2007-07-01 20:08         ` Stefan Monnier [this message]
2007-07-01 20:44           ` Paul Pogonyshev
2007-07-01 21:23             ` Stefan Monnier
2007-07-01 16:32     ` Richard Stallman
2007-07-01 16:32     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv7ipjhovh.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=pogonyshev@gmx.net \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).