Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix revno 100152.

 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.
  • Loading branch information...
commit ac7458ac240d0f09dff5dc5b84a60149276149ad 1 parent 0d33bea
Eli Zaretskii authored
Showing with 19 additions and 1 deletion.
  1. +8 −0 src/ChangeLog
  2. +10 −0 src/keyboard.c
  3. +1 −1  src/process.c
8 src/ChangeLog
View
@@ -1,5 +1,13 @@
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
10 src/keyboard.c
View
@@ -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. */
2  src/process.c
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.