unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Fixing bug #22983 (syntax-ppss is broken)
Date: Wed, 8 Feb 2017 21:03:57 +0000	[thread overview]
Message-ID: <20170208210357.GA9444@acm> (raw)

Hello, Emacs.

Just an idea to throw around.

syntax-ppss is broken.  It tends to return false results when the buffer
is narrowed, and its invalidation routines are not comprehensive enough
- for example, invalidation doesn't happen when a new syntax table is
selected, or syntax-table text properties are applied to a buffer.

Examining the use made of syntax-ppss in Emacs, out of ~180 instances,
there are only a handful which deal with anything other than comments
and strings.  Perhaps 10 - 20.

Stefan and Dmitry have objected to the comment-cache branch on the
grounds it "duplicates" the syntax-ppss cache.  Well, how about
abandoning the problematic syntax-ppss and using the comment-cache cache
in its place?  comment-cache features rock solid cache invalidation.

Also, comment-cache is faster than syntax-ppss (a lookup of a text
property compared with a linerar list search followed by a
parse-partial-sexp over up to 20,000 characters).  So this strategy
would speed Emacs up somewhat.

That would just leave the aforementioned handful of cases to be hand
coded.  Then we could deprecate syntax-ppss and remove it at a future
release.

:-)

-- 
Alan Mackenzie (Nuremberg, Germany).



                 reply	other threads:[~2017-02-08 21:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20170208210357.GA9444@acm \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /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).