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 22:22:57 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.1.0



On 20.06.2016 20:55, Alan Mackenzie wrote:
Hello, Andreas.

On Mon, Jun 20, 2016 at 06:00:01PM +0200, Andreas Röhler wrote:


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 agree wholeheartedly.

I'd prever to see an example, where syntax-ppss can't be replaced by
parse-partial-sexp.
Well, syntax-ppss was originally intended to give the result equivalent
to (parse-partial-sexp (point-min) pos), and probably does, providing the
buffer is never narrowed - with narrowing, you get a somewhat random
result.

 From there designing a syntax-ppss capable of its tasks might be of
interest.
One of the problems is that syntax-ppss, rather than just performing its
function, has the subsidiary function of applying syntax-table text
properties.  Eliminating this incoherence would be a good design aim.
In fact, finding a good way of applying the text properties would win
you a medal, in my eyes.


Thanks Alan. It should be possible to find a simpler solution avoiding circular calls.
Nonetheless, rethinking it from scratch might take some time too.
May you open a branch for this? Ideally with its own bug-tracker?

Another problem: signed only the disclaimer to FSF, not the complete copyright assignment paper. So my role would be restricted being a tester and critique rather than an active writer... ;)





reply via email to

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