all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: damien@cassou.me, 40317@debbugs.gnu.org,
	Jeff Norden <jnorden@tntech.edu>
Subject: bug#40317: 27.0.90; Reverting a buffer that visits C file signals an error
Date: Sat, 19 Sep 2020 11:48:12 +0000	[thread overview]
Message-ID: <20200919114812.GB6057@ACM> (raw)
In-Reply-To: <83zh5m2p8p.fsf@gnu.org>

Hello, Eli.

On Sat, Sep 19, 2020 at 10:35:18 +0300, Eli Zaretskii wrote:
> > From: Jeff Norden <jnorden@tntech.edu>
> > Cc: 40317@debbugs.gnu.org, eliz@gnu.org,
> >   damien@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@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).





  reply	other threads:[~2020-09-19 11:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29 13:26 bug#40317: 27.0.90; Reverting a buffer that visits C file signals an error Eli Zaretskii
2020-09-16 12:24 ` Damien Cassou
2020-09-16 14:26   ` Eli Zaretskii
2020-09-16 14:51     ` Damien Cassou
2020-09-16 15:09       ` Eli Zaretskii
2020-09-16 18:19         ` Damien Cassou
2020-09-18  1:21           ` Jeff Norden
2020-09-18 19:46             ` Damien Cassou
2020-09-18 20:13             ` Alan Mackenzie
2020-09-18 22:03               ` Jeff Norden
2020-09-19  7:35                 ` Eli Zaretskii
2020-09-19 11:48                   ` Alan Mackenzie [this message]
2020-09-20 17:25       ` Alan Mackenzie
2020-10-29 14:19         ` Damien Cassou
2022-02-20 15:11           ` Lars Ingebrigtsen
2022-02-21 10:09             ` Damien Cassou
2022-02-21 14:08               ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200919114812.GB6057@ACM \
    --to=acm@muc.de \
    --cc=40317@debbugs.gnu.org \
    --cc=damien@cassou.me \
    --cc=eliz@gnu.org \
    --cc=jnorden@tntech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.