[Top][All Lists]

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

Fixing bug #22983 (syntax-ppss is broken)

From: Alan Mackenzie
Subject: Fixing bug #22983 (syntax-ppss is broken)
Date: Wed, 8 Feb 2017 21:03:57 +0000
User-agent: Mutt/1.7.2 (2016-11-26)

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


Alan Mackenzie (Nuremberg, Germany).

reply via email to

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