unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: bug#20352: Factor 2 slow down of font-locking in c-mode
Date: Mon, 4 May 2015 10:33:38 +0000	[thread overview]
Message-ID: <20150504103338.GA3902@acm.fritz.box> (raw)
In-Reply-To: <jwvd22h3xh9.fsf-monnier+emacsbugs@gnu.org>

Hello, Stefan.

On Sun, May 03, 2015 at 10:13:48PM -0400, Stefan Monnier wrote:
> > Indeed.  Some while ago, you were musing on putting syntax-ppss, or
> > equivalent, into syntax.c, thus rendering
> > open-paren-in-column-0-is-defun-start unnecessary and obsolete.  This
> > would speed up or improve the accuracy of, in particular, back_comment
> > and the stacks of things which depend upon it.

> > Is this enhancement still intended?

> Not in the short term, no.  I've toyed with it, but there's a problem:
> syntax-ppss's caching relies on the syntax-table being constant.
> This usually works fine because the callers "know" to call syntax-ppss
> outside of with-syntax-table (I guess in reality they don't really know,
> but they happen to do that because they call syntax-ppss fairly early
> on), but it's not uncommon for Elisp code (definitely including CC-mode)
> to use with-syntax-table around calls to forward-sexp/comment, so
> calling syntax-ppss implicitly from within those functions exposes this
> underlying syntax-ppss limitation.

Ah.  That sounds like a shame.

> IOW, it can't be done until we figure out how to make syntax-ppss handle
> syntax-table changes.

How about having an association list of ((syntax-table . cache) ...), or
something like that?  Each cache would need its own value of the
equivalent of `syntax-propertize--done'.  `modify-syntax-entry' would
need to wipe the cache.  Then there are `category' text
properties/overlays which might affect the syntax.  And so on.  And so
on.

OK.  It's difficult.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



      reply	other threads:[~2015-05-04 10:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150417191005.4119.qmail@mail.muc.de>
     [not found] ` <jwv618uukei.fsf-monnier+emacsbugs@gnu.org>
     [not found]   ` <20150418094552.GA4182@acm.fritz.box>
     [not found]     ` <jwvoamlv8qy.fsf-monnier+emacsbugs@gnu.org>
2015-05-03 21:33       ` bug#20352: Factor 2 slow down of font-locking in c-mode Alan Mackenzie
2015-05-04  2:13         ` Stefan Monnier
2015-05-04 10:33           ` Alan Mackenzie [this message]

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=20150504103338.GA3902@acm.fritz.box \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).