Date: Fri, 9 Sep 2022 16:10:07 +0200
Cc: emacs-devel@gnu.org
From: Gerd Möllmann <gerd.moellmann@gmail.com>
It wouldn't be hard to buffer the writes until the update is done, I
think.
I think we already do, see this part of update_frame_1:
/* Now update the rest of the lines. */
for (i = 0; i < desired_matrix->nrows - 1 && (force_p || !input_pending);
i++)
{
if (MATRIX_ROW_ENABLED_P (desired_matrix, i))
{
if (FRAME_TERMCAP_P (f))
{
/* Flush out every so many lines.
Also flush out if likely to have more than 1k buffered
otherwise. I'm told that some telnet connections get
really screwed by more than 1k output at once. */
FILE *display_output = FRAME_TTY (f)->output;
if (display_output)
{
ptrdiff_t outq = __fpending (display_output);
if (outq > 900
|| (outq > 20 && ((i - 1) % preempt_count == 0)))
fflush (display_output);
}
}