changeset 13454:1a16700ce493

(interrupt_signal): Do special things in GC.
author Richard M. Stallman <rms@gnu.org>
date Fri, 10 Nov 1995 15:54:33 +0000
parents ea373c55ed95
children 4f5a9ce67782
files src/keyboard.c
diffstat 1 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Nov 10 15:48:13 1995 +0000
+++ b/src/keyboard.c	Fri Nov 10 15:54:33 1995 +0000
@@ -6949,18 +6949,35 @@
 	 is used.  Note that [Enter] is not echoed by dos.  */
       cursor_to (0, 0);
 #endif
-      printf ("Auto-save? (y or n) ");
-      fflush (stdout);
-      if (((c = getchar ()) & ~040) == 'Y')
+      /* It doesn't work to autosave while GC is in progress;
+	 the code used for auto-saving doesn't cope with the mark bit.  */
+      if (!gc_in_progress)
 	{
-	  Fdo_auto_save (Qt, Qnil);
+	  printf ("Auto-save? (y or n) ");
+	  fflush (stdout);
+	  if (((c = getchar ()) & ~040) == 'Y')
+	    {
+	      Fdo_auto_save (Qt, Qnil);
 #ifdef MSDOS
-	  printf ("\r\nAuto-save done");
+	      printf ("\r\nAuto-save done");
 #else /* not MSDOS */
-	  printf ("Auto-save done\n");
+	      printf ("Auto-save done\n");
 #endif /* not MSDOS */
+	    }
+	  while (c != '\n') c = getchar ();
 	}
-      while (c != '\n') c = getchar ();
+      else 
+	{
+	  /* During GC, it must be safe to reenable quitting again.  */
+	  Vinhibit_quit = Qnil;
+#ifdef MSDOS
+	  printf ("\r\n");
+#endif /* not MSDOS */
+	  printf ("Garbage collection in progress; cannot auto-save now\r\n");
+	  printf ("but will instead do a real quit after garbage collection ends\r\n");
+	  fflush (stdout);
+	}
+
 #ifdef MSDOS
       printf ("\r\nAbort?  (y or n) ");
 #else /* not MSDOS */