Subject: Re: bug#21465: [PATCH] CC-modes hierarchy

From: Alan Mackenzie <[email-masked]>
Date: Wed, 16 Sep 2015 13:57:12 +0000

Hello, Stefan.

On Mon, Sep 14, 2015 at 09:06:06PM -0400, Stefan Monnier wrote:
> > c-after-font-lock-init surely isn't broken.  c-after-change is ALWAYS on
> > after-change-functions.

> No, it's not.  Not in my sm-awk-mode which derives from awk-mode.
> Or rather, I don't want it there and c-after-font-lock-init forces it
> down my throat again after I removed it.

> > Without it, CC Mode simply wouldn't function.

> It does.

It may appear to, but c-after-change does important things like
invalidating caches, and preparing the buffer for font locking.  Sooner
or later, something will go wrong.  (Unless you've put in an
sm-c-after-change, or something like that.)  But you probably know this.

This is one of these "please don't report any bugs whilst this is
active".

> Besides, my patch does not remove c-after-change from
> after-change-functions.  It just stops c-after-font-lock-init from
> re-adding it if someone decided to remove it.

The impression should not be given that c-after-change is in any way an
optional extra.  It's essential to CC Mode.

Why do you want to remove it from your setup?

> AFAIK c-after-change is never removed from after-change-functions by
> accident, so re-adding it blindly is a bug.

I don't think so.  Anybody advanced/foolish enough to remove it will
know how to remove it even after c-after-font-lock-init has inserted it.
This isn't something that should be encouraged.

Again, why do you want to take it out of your Awk Mode?

[ .... ]

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).