mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 22:40:51 -08:00
(BUFFER_SIZE_FACTOR): Remove.
(read_input_waiting): Adapt to new read_socket_hook interface. Remove allocation and initialization of local input_event buffer, as read_socket_hook stores events directly in fifo. Allocate and initialize local hold_quit event to handle postponed quit event (and store it if set by kbd_buffer_store_event_hold).
This commit is contained in:
parent
ff158530cb
commit
9f893fc68f
1 changed files with 8 additions and 22 deletions
30
src/sysdep.c
30
src/sysdep.c
|
|
@ -2614,13 +2614,6 @@ sys_select (nfds, rfds, wfds, efds, timeout)
|
|||
/* Read keyboard input into the standard buffer,
|
||||
waiting for at least one character. */
|
||||
|
||||
/* Make all keyboard buffers much bigger when using a window system. */
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
#define BUFFER_SIZE_FACTOR 16
|
||||
#else
|
||||
#define BUFFER_SIZE_FACTOR 1
|
||||
#endif
|
||||
|
||||
void
|
||||
read_input_waiting ()
|
||||
{
|
||||
|
|
@ -2629,26 +2622,19 @@ read_input_waiting ()
|
|||
|
||||
if (read_socket_hook)
|
||||
{
|
||||
struct input_event buf[256];
|
||||
for (i = 0; i < 256; i++)
|
||||
EVENT_INIT (buf[i]);
|
||||
|
||||
struct input_event hold_quit;
|
||||
|
||||
EVENT_INIT (hold_quit);
|
||||
hold_quit.kind = NO_EVENT;
|
||||
|
||||
read_alarm_should_throw = 0;
|
||||
if (! setjmp (read_alarm_throw))
|
||||
nread = (*read_socket_hook) (0, buf, 256, 1);
|
||||
nread = (*read_socket_hook) (0, 1, &hold_quit);
|
||||
else
|
||||
nread = -1;
|
||||
|
||||
/* Scan the chars for C-g and store them in kbd_buffer. */
|
||||
for (i = 0; i < nread; i++)
|
||||
{
|
||||
kbd_buffer_store_event (&buf[i]);
|
||||
/* Don't look at input that follows a C-g too closely.
|
||||
This reduces lossage due to autorepeat on C-g. */
|
||||
if (buf[i].kind == ASCII_KEYSTROKE_EVENT
|
||||
&& buf[i].code == quit_char)
|
||||
break;
|
||||
}
|
||||
if (hold_quit.kind != NO_EVENT)
|
||||
kbd_buffer_store_event (&hold_quit);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue