aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-02-27 23:47:48 +0000
committerKim F. Storm2004-02-27 23:47:48 +0000
commit9f893fc68f7cb32ef68c2bf013adcd8fd01c1210 (patch)
tree1bc6f94723698b6e2b15596513f2884e7d1ca074 /src
parentff158530cbc6f357fba722e867be0673568345d1 (diff)
downloademacs-9f893fc68f7cb32ef68c2bf013adcd8fd01c1210.tar.gz
emacs-9f893fc68f7cb32ef68c2bf013adcd8fd01c1210.zip
(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).
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 96f857432a8..5ede3d27208 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2614,13 +2614,6 @@ sys_select (nfds, rfds, wfds, efds, timeout)
2614/* Read keyboard input into the standard buffer, 2614/* Read keyboard input into the standard buffer,
2615 waiting for at least one character. */ 2615 waiting for at least one character. */
2616 2616
2617/* Make all keyboard buffers much bigger when using a window system. */
2618#ifdef HAVE_WINDOW_SYSTEM
2619#define BUFFER_SIZE_FACTOR 16
2620#else
2621#define BUFFER_SIZE_FACTOR 1
2622#endif
2623
2624void 2617void
2625read_input_waiting () 2618read_input_waiting ()
2626{ 2619{
@@ -2629,26 +2622,19 @@ read_input_waiting ()
2629 2622
2630 if (read_socket_hook) 2623 if (read_socket_hook)
2631 { 2624 {
2632 struct input_event buf[256]; 2625 struct input_event hold_quit;
2633 for (i = 0; i < 256; i++) 2626
2634 EVENT_INIT (buf[i]); 2627 EVENT_INIT (hold_quit);
2635 2628 hold_quit.kind = NO_EVENT;
2629
2636 read_alarm_should_throw = 0; 2630 read_alarm_should_throw = 0;
2637 if (! setjmp (read_alarm_throw)) 2631 if (! setjmp (read_alarm_throw))
2638 nread = (*read_socket_hook) (0, buf, 256, 1); 2632 nread = (*read_socket_hook) (0, 1, &hold_quit);
2639 else 2633 else
2640 nread = -1; 2634 nread = -1;
2641 2635
2642 /* Scan the chars for C-g and store them in kbd_buffer. */ 2636 if (hold_quit.kind != NO_EVENT)
2643 for (i = 0; i < nread; i++) 2637 kbd_buffer_store_event (&hold_quit);
2644 {
2645 kbd_buffer_store_event (&buf[i]);
2646 /* Don't look at input that follows a C-g too closely.
2647 This reduces lossage due to autorepeat on C-g. */
2648 if (buf[i].kind == ASCII_KEYSTROKE_EVENT
2649 && buf[i].code == quit_char)
2650 break;
2651 }
2652 } 2638 }
2653 else 2639 else
2654 { 2640 {