emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock-syntactic-keywords obsolet?


From: Andreas Röhler
Subject: Re: font-lock-syntactic-keywords obsolet?
Date: Mon, 20 Jun 2016 18:00:01 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.1.0



On 20.06.2016 15:50, Dmitry Gutov wrote:
On 06/20/2016 04:37 PM, Stefan Monnier wrote:
I've tried doing this with an actual bug, namely bug #22983 "syntax-ppss
returns wrong result".  That was over three months ago, and still there
is no fix.

Indeed, no fix.  A few reasons:
- Lack of a concrete case which suffers from it (not much immediate benefit). - In many cases, it's easier to fix the other side (the caller of syntax-ppss).
- It's hard to fix it right, not because of syntax-ppss in particular,
  but because it's hard to make a generic facility which can be fast by
  using a cache, yet is not being told where is the real intended
  beginning of the buffer.  In CC-mode you just decided to punt and
  disallow the use of cc-mode where 1 is not the real beginning of the
  C code.  So your approach suffers from the same problem (just the
  other side of it) and you haven't fixed it either.

This said, a quick&dirty fix (if such was needed, e.g. because of a concrete
case which exhibits the problem) would be to make syntax-ppss
always widen (and maybe add a syntax-ppss-dont-widen).  Given that
there's no real hurry to fix it, I'd rather we fix it right.

I'm very tempted to fix it by pushing the proposed patch into master, considering no viable alternative patch has been proposed so far, if only to avoid seeing Alan mention that bug for the 101th time


IMHO syntax-ppss has many design issues, not a single one. I'd prever to see an example, where syntax-ppss can't be replaced by parse-partial-sexp. From there designing a syntax-ppss capable of its tasks might be of interest.



reply via email to

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