Commit 86520d8c authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix 2010-05-05T22:14:15Z!lekktu@gmail.com.

 keyboard.c (kbd_buffer_nr_stored): Define only ifdef subprocesses.
 (kbd_buffer_store_event_hold, kbd_buffer_get_event)
 (tty_read_avail_input): Call kbd_buffer_nr_stored only ifdef
 subprocesses.  Use buffer_free only ifdef subprocesses.
 process.c (init_process) [subprocesses]: Init kbd_is_on_hold in
 the subprocesses version, not in the non-subprocesses one.
parent 794a4b6d
2010-11-09 Eli Zaretskii <eliz@gnu.org>
* keyboard.c (kbd_buffer_nr_stored): Define only ifdef subprocesses.
(kbd_buffer_store_event_hold, kbd_buffer_get_event)
(tty_read_avail_input): Call kbd_buffer_nr_stored only ifdef
subprocesses. Use buffer_free only ifdef subprocesses.
* process.c (init_process) [subprocesses]: Init kbd_is_on_hold in
the subprocesses version, not in the non-subprocesses one.
* Makefile.in: Don't use ## comment, it breaks the MSDOS build.
* xfns.c (x_real_positions): Fix declaration-after-statement
......
......@@ -3783,6 +3783,7 @@ event_to_kboard (event)
return FRAME_KBOARD (XFRAME (frame));
}
#ifdef subprocesses
/* Return the number of slots occupied in kbd_buffer. */
static int
......@@ -3795,6 +3796,7 @@ kbd_buffer_nr_stored (void)
: ((kbd_buffer + KBD_BUFFER_SIZE) - kbd_fetch_ptr
+ (kbd_store_ptr - kbd_buffer)));
}
#endif /* subprocesses */
Lisp_Object Vthrow_on_input;
......@@ -3918,6 +3920,7 @@ kbd_buffer_store_event_hold (event, hold_quit)
{
*kbd_store_ptr = *event;
++kbd_store_ptr;
#ifdef subprocesses
if (kbd_buffer_nr_stored () > KBD_BUFFER_SIZE/2 && ! kbd_on_hold_p ())
{
/* Don't read keyboard input until we have processed kbd_buffer.
......@@ -3929,6 +3932,7 @@ kbd_buffer_store_event_hold (event, hold_quit)
#endif
stop_polling ();
}
#endif /* subprocesses */
}
/* If we're inside while-no-input, and this event qualifies
......@@ -4097,6 +4101,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
register int c;
Lisp_Object obj;
#ifdef subprocesses
if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4)
{
/* Start reading input again, we have processed enough so we can
......@@ -4108,6 +4113,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
#endif /* SIGIO */
start_polling ();
}
#endif /* subprocesses */
if (noninteractive
/* In case we are running as a daemon, only do this before
......@@ -7308,10 +7314,12 @@ tty_read_avail_input (struct terminal *terminal,
int n_to_read, i;
struct tty_display_info *tty = terminal->display_info.tty;
int nread = 0;
#ifdef subprocesses
int buffer_free = KBD_BUFFER_SIZE - kbd_buffer_nr_stored () - 1;
if (kbd_on_hold_p () || buffer_free <= 0)
return 0;
#endif /* subprocesses */
if (!terminal->name) /* Don't read from a dead terminal. */
return 0;
......@@ -7393,9 +7401,11 @@ tty_read_avail_input (struct terminal *terminal,
#endif
#endif
#ifdef subprocesses
/* Don't read more than we can store. */
if (n_to_read > buffer_free)
n_to_read = buffer_free;
#endif /* subprocesses */
/* Now read; for one reason or another, this will not block.
NREAD is set to the number of chars read. */
......
......@@ -7356,6 +7356,7 @@ init_process ()
register int i;
inhibit_sentinels = 0;
kbd_is_on_hold = 0;
#ifdef SIGCHLD
#ifndef CANNOT_DUMP
......@@ -8093,7 +8094,6 @@ integer or floating point values.
void
init_process ()
{
kbd_is_on_hold = 0;
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment