From: Gerd Moellmann Date: Fri, 18 Aug 2000 03:13:27 +0000 (+0000) Subject: (kbd_buffer_get_event): Handle the case that the X-Git-Tag: emacs-pretest-21.0.90~2190 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e4457b09c80553497e5930a2c0b0a6125f53d927;p=emacs.git (kbd_buffer_get_event): Handle the case that the second half of a HELP_EVENT is found at the start of kbd_buffer. --- diff --git a/src/keyboard.c b/src/keyboard.c index 4d48c22f30e..97687aad09f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3474,22 +3474,26 @@ kbd_buffer_get_event (kbp, used_mouse_menu) kbd_fetch_ptr = event + 1; else if (event->kind == HELP_EVENT) { - /* There are always two consecutive HELP_EVENTs in the - input queue. */ + /* There are always two HELP_EVENTs in the input queue. */ Lisp_Object object, position, help, frame, window; - + xassert (event->code == 0); frame = event->frame_or_window; object = event->arg; position = event->x; - xassert ((event + 1)->code == 1); - help = (event + 1)->arg; - window = (event + 1)->frame_or_window; + + kbd_fetch_ptr = event + 1; + event = ((kbd_fetch_ptr < kbd_buffer + KBD_BUFFER_SIZE) + ? kbd_fetch_ptr + : kbd_buffer); + xassert (event->code == 1); + help = event->arg; + window = event->frame_or_window; if (!WINDOWP (window)) window = Qnil; obj = Fcons (Qhelp_echo, list5 (frame, help, window, object, position)); - kbd_fetch_ptr = event + 2; + kbd_fetch_ptr = event + 1; } else if (event->kind == FOCUS_IN_EVENT) {