GNU bug report logs -
#40317
27.0.90; Reverting a buffer that visits C file signals an error
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Mon, 30 Mar 2020 02:36:22 UTC
Severity: normal
Tags: moreinfo
Found in version 27.0.90
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #38 received at 40317 <at> debbugs.gnu.org (full text, mbox):
Hello, Eli.
On Sat, Sep 19, 2020 at 10:35:18 +0300, Eli Zaretskii wrote:
> > From: Jeff Norden <jnorden <at> tntech.edu>
> > Cc: 40317 <at> debbugs.gnu.org, eliz <at> gnu.org,
> > damien <at> cassou.me
> > Date: Fri, 18 Sep 2020 17:03:07 -0500
> > Somehow, and I sure don't know how, I think that c-after-change gets
> > called with: c-new-END already set to the value of point-max after the
> > insertion; and with the other variables set so that that beg, end, and
> > old-len remain unchanged. It's the only scenario that I can see that
> > fits the backtrace that Eli posted.
> > If Damien and/or Eli can temporarily try out the test that I suggested
> > and get it to trigger, I think that would verify this. In fact, maybe
> > warn would be even better:
> > (if (> c-new-END (point-max))
> > (warn "c-new-END is too big! %d > %d" c-new-END (point-max)))
> Unfortunately, the problem no longer happens to me, not in many
> moons. Not sure why: I didn't change my usage patterns.
The reason is the following patch, which was committed slightly before
you reported the bug, but before you had updated your Emacs to include
it:
commit a3c2d186eb514b505e61c2a89a1df886dbfcb06b
Author: Alan Mackenzie <acm <at> muc.de>
Date: Wed Mar 4 21:17:04 2020 +0000
CC Mode: Fix the handling of two adjacent after-change-functionses.
The bug involved failing to set c-new-END correctly, which lead to an
args-out-of-range error when after-change-functions was invoked twice without
an intervening invocation of before-change-functions.
* lisp/progmodes/cc-mode.el (c-after-change): Correct a coding error in the
handling of c-just-done-before-change.
What triggered the bug there was insert-file-contents not calling
before-change-functions when called from revert-buffer.
> Hopefully, Damien will be able to test this theory. Thanks.
What Damien has found appears to be a bug distinct from the one you
reported in March.
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 3 years and 84 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.