[Top][All Lists]

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

Re: Unbalanced change hooks (part 2)

From: Alan Mackenzie
Subject: Re: Unbalanced change hooks (part 2)
Date: Sun, 31 Jul 2016 19:33:20 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Stefan.

On Sun, Jul 31, 2016 at 02:55:32PM -0400, Stefan Monnier wrote:
> >     These hook variables let you arrange to take notice of ALL changes
> >     in ALL buffers.  [My emphasis]

> > Your interpretation of that seems to be that each buffer change will
> > call _at least_ one of before-... and after-..., but not necessarily
> > both.  That doesn't seem sensible to me.

> I fully agree that if you only use before-change-functions (or only use
> after-change-functions), your hook function should see *all* changes.

Taking your parenthetical clause to be an essential part of your
sentence, this can only happen if all changes cause both before- and
after-change-functions to be called.  (A major mode "registering" which
one of before- or after- it wishes to see would be ludicrous.)

> This is an important property and if there are places where this is not
> the case, we should fix them.

I agree, it's what I'm proposing and trying to persuade Eli to accept.

> > No.  A program (such as CC Mode) reacts to a _change_, not merely to
> > what a buffer looks like after a change.

> But here we have a problem: I don't think that
> before/after-change-functions should be always be properly paired, which
> IIUC is a property that CC-mode relies on.

That appears to contradict your first paragraph.  CC Mode does indeed
rely on this proper pairing.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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