[Top][All Lists]

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

bug#16526: 24.3.50; scroll-conservatively & c-mode regression

From: Alan Mackenzie
Subject: bug#16526: 24.3.50; scroll-conservatively & c-mode regression
Date: Wed, 2 Jul 2014 18:40:13 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, Stefan.

On Sun, Jun 29, 2014 at 06:14:45PM -0400, Stefan Monnier wrote:
> > scan-lists, a primitive, must be utterly robust.  syntax-ppss is too
> > fragile to be used here without a lot of hardening.

> FWIW, CC-mode is one of the last remaining major modes (at least the
> only one I know of that's bundled with Emacs) that doesn't play nice
> with syntax-ppss.

Doesn't it?  First I've heard of it.  Though of course, what comes out
of syntax-ppss is going to be of limited value when you've got lines
like this in your source:

    #define FOO BAR /* accidentally unclosed comment.

Just as a matter of interest, what code is there around which wants to
use syntax-ppss on a CC Mode buffer?

> Incidentally, AFAIK it's also the only code which uses
> font-lock-extend-after-change-region-function ....

Is that right?  Well, what do you know!  Still, it's a good facility to
have around for when it's needed.  It avoids the need to have to advise
font-lock after change functions, whilst still doing fontification

> .... (and yes, I think the two are (indirectly) related).

Well, everything's related to everything else, more or less indirectly.
Do you think there's any significance to this indirect relationship?

> > If one were to harden syntax-ppss against all these things, one would
> > probably end up calculating the cache from scratch every time, in effect.

> Exactly.  IOW a cache can only be robust if the major mode plays by the
> rules, which cc-mode doesn't do.

CC Mode does what it has to do to do its job.  As you yourself, amongst
others, have remarked, CC Mode deals with utter bastards of languages.
Its caches are quite capable of being robust.  I'm not convinced that
syntax-ppss is capable of being robust.  Some of its shortcomings are
listed in syntax.el.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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