GNU bug report logs - #16526
24.3.50; scroll-conservatively & c-mode regression

Previous Next

Packages: emacs, cc-mode;

Reported by: martin rudalics <rudalics <at> gmx.at>

Date: Thu, 23 Jan 2014 08:54:02 UTC

Severity: important

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #231 received at 16526-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: martin rudalics <rudalics <at> gmx.at>, 16526-done <at> debbugs.gnu.org
Subject: Re: bug#16526: 24.3.50; scroll-conservatively & c-mode regression
Date: Wed, 2 Jul 2014 18:40:13 +0000
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
right.

> .... (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).




This bug report was last modified 11 years and 16 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.