Subject: Re: bug#73743: Auto-save dialog needs extra RET

From: Eli Zaretskii <[email-masked]>
Date: Fri, 18 Oct 2024 09:11:37 +0300

> From: Richard Stallman <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Thu, 17 Oct 2024 22:29:59 -0400
> 
>   > > the failure to move on to the next question seems like a bug.
>   > > Why is it waiting for the user to type RET?
> 
>   > It doesn't.  It calls read_stdin, which reads 1 byte.
> 
> We may be miscommunicating.
> After "Auto-save done", it should ask the next question, right?
> Why does it instead try to read a character at that point
> before asking another question?

Probably because it expects the user to type 'y RET', not just 'y'.
My guess is that we want the user to consciously type the response,
not just touch some random key and then "oops".

But I can only guess the reason; you are the best person to know why,
since you wrote that code back in 1992 or before, when keyboard.c was
first added to the Emacs version control.  Here's how that code looked
back then:

      printf ("Auto-save? (y or n) ");
      fflush (stdout);
      if (((c = getchar ()) & ~040) == 'Y')
        Fdo_auto_save (Qnil, Qnil);
      while (c != '\n') c = getchar ();
#ifdef VMS
      printf ("Abort (and enter debugger)? (y or n) ");
#else /* not VMS */
      printf ("Abort (and dump core)? (y or n) ");
#endif /* not VMS */
      fflush (stdout);
      if (((c = getchar ()) & ~040) == 'Y')
        abort ();
      while (c != '\n') c = getchar ();
      printf ("Continuing...\n");
      fflush (stdout);
      init_sys_modes ();

As you see, both questions expect 'y RET' or 'n RET' as user response.