diff options
| author | Gerd Möllmann | 2022-09-11 11:42:18 +0200 |
|---|---|---|
| committer | Gerd Möllmann | 2022-09-17 15:33:10 +0200 |
| commit | cbac94b4aeecdf57e2a1f3e95e27ec76505ae964 (patch) | |
| tree | d9f6c4bc4a5313849d57aa14bbb57e59f6564ff2 /src/sysdep.c | |
| parent | 5bf8f9cc0d2fb12071301f50f9b85640d240a1fc (diff) | |
| download | emacs-cbac94b4aeecdf57e2a1f3e95e27ec76505ae964.tar.gz emacs-cbac94b4aeecdf57e2a1f3e95e27ec76505ae964.zip | |
Optimize tty display updates (bug#57727)
* src/dispnew.c (update_frame_1): Don'f flush if tty's
output_buffer_size is non-zero.
* src/sysdep.c (init_sys_modes): Setvbuf depending on the tty's
output_buffer_size.
* src/term.c (Ftty__set_output_buffer_size, Ftty__output_buffer_size):
Low-level interface for setting and retrieving a tty's output buffer
size.
(syms_of_term): Defsubr the new functions.
* src/termchar.h (struct tty_display_info): New member
output_buffer_size.
* stc/NEWS: Describe the change.
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index efd9638b07a..abb385d1388 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1304,7 +1304,10 @@ init_sys_modes (struct tty_display_info *tty_out) | |||
| 1304 | } | 1304 | } |
| 1305 | #endif /* F_GETOWN */ | 1305 | #endif /* F_GETOWN */ |
| 1306 | 1306 | ||
| 1307 | setvbuf (tty_out->output, NULL, _IOFBF, BUFSIZ); | 1307 | const size_t buffer_size = (tty_out->output_buffer_size |
| 1308 | ? tty_out->output_buffer_size | ||
| 1309 | : BUFSIZ); | ||
| 1310 | setvbuf (tty_out->output, NULL, _IOFBF, buffer_size); | ||
| 1308 | 1311 | ||
| 1309 | if (tty_out->terminal->set_terminal_modes_hook) | 1312 | if (tty_out->terminal->set_terminal_modes_hook) |
| 1310 | tty_out->terminal->set_terminal_modes_hook (tty_out->terminal); | 1313 | tty_out->terminal->set_terminal_modes_hook (tty_out->terminal); |