Subject: Re: bug#17405: C-g C-g in GC does not autosave

From: Eli Zaretskii <[email-masked]>
Date: Fri, 04 Dec 2020 14:33:29 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Fri, 04 Dec 2020 12:58:51 +0100
> Cc: [email-masked]
> 
> Richard Stallman <[email-masked]> writes:
> 
> > I think Emacs used to be smart enough to autosave from C-g C-g
> > within a GC.  I guess that broke and someone decided to fix it
> > by not trying to autosave.
> >
> > Can't we make it autosave correctly?
> 
> I think that sounds like somewhat surprising behaviour -- why should
> `C-g C-g' (at any time) autosave?

Because "C-g C-g" (if you type it fast enough) triggers the so-called
"emergency escape", whereby we might abort and dump core, subject to
user's confirmation.  See handle_interrupt in keyboard.c.

The answer to Richard's question is that this "someone who decided to
fix it" was Richard himself, back in Nov 2995 (see commit 118d6ca).
The comment to the "not in GC" condition explains this:

      /* It doesn't work to autosave while GC is in progress;
	 the code used for auto-saving doesn't cope with the mark bit.  */

Maybe we should see whether this is still the case, i.e. whether
auto-saving still cannot cope with the mark bit.