Subject: bug#24074: bug#24094: 25.1.50; revert-buffer error in CC mode

From: Richard Copley <[email-masked]>
Date: Fri, 29 Jul 2016 19:16:50 +0100

On 29 July 2016 at 18:59, Alan Mackenzie <[email-masked]> wrote:
> Hello, Richard.

Hi!

> In article <[email-masked]> you wrote:
>> When editing C++ files, if I change visited files outside emacs (for
>> example, by doing "svn revert -R ."), then visit one of the changed
>> files and accept the offer to revert the buffer, in some cases there
>> is an error (see below) and the buffer contents are corrupted (chunks
>> are missing because the revert operation was interrupted).
>
> This looks like the same bug as bug #24074, but you've managed to capture
> a backtrace, for which many thanks.

Yes, I think it is likely the same bug (if I'd noticed #24074 sooner,
I would have sent the backtrace there). Happy to help.

> Could you be a bit more descriptive about the "chunks" that are missing,
> please?  Are we talking about lots of isolated 2-character chunks, or
> just one or two larger chunks, or what?  Are the chunks at the end of a
> buffer, or in the "middle" of it?

It's hard to describe precisely (especially as I don't have a
corrupted buffer here and now), but being guided by your question,
we're talking about one or two larger chunks and not at the end of the
buffer but in the "middle".

My impression FWIW is that it is *as if* Emacs has done
"diff-buffer-with-file" and is attempting to apply the resulting patch
to the buffer (perhaps with the laudable intention of saving space in
the undo buffer), and has failed after a deletion and before an
insertion. But that is uninformed speculation.

>> I haven't been able to reduce this to a recipe and I don't know if
>> the issue is present in the emacs-25 branch and/or in "emacs -Q".
>
> Almost certainly, the bug isn't in the emacs-25 branch, because the
> function c-before-after-change-digit-quote isn't in that branch.

That's useful to know.
Thanks Alan.