emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-27 3bce7ec: CC Mode: Protect against consecutive calls to befo


From: Alan Mackenzie
Subject: Re: emacs-27 3bce7ec: CC Mode: Protect against consecutive calls to before-change-functions ...
Date: Sun, 1 Mar 2020 21:26:57 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Mattias and Glenn.

On Sun, Mar 01, 2020 at 12:49:39 +0100, Mattias EngdegÄrd wrote:
> 28 feb. 2020 kl. 17.54 skrev Glenn Morris <address@hidden>:

> >>   CC Mode: Protect against consecutive calls to before-change-functions ...

> > This causes srecode-utest-getset-output in
> > test/lisp/cedet/srecode-utest-getset.el to fail:

> Indeed, and so does electric-tests. Condensed reproduction:

> (with-temp-buffer
>   (c-mode)
>   (insert "a")
>   (comment-region (point-min) (point-max)))

> Alan, it looks like the code has lost control over c-new-END.
> c-after-change over-adjusts it to a value beyond the buffer size.  The
> problem seems to go away with the expedient below but it is unlikely
> to be the right solution.

The cause of this bug is a bug in combine-change-calls-1 which shows
itself when buffer-undo-list is t (as I presume it is for the
with-temp-buffer).  In this circumstance, the routine fails to bind
before/after-change-functions to nil (or something close to it) before
invoking combine-change-call's ,@body.

So, we get two invocations of before-change-functions in a row, which
fouls things up.

I have tried a fix to combine-change-calls-1, and it appears to work.  I
will tidy it up and post it here soon (?tomorrow).

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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