]> git.eshelyaron.com Git - emacs.git/commitdiff
(kbd_buffer_get_event): Handle the case that the
authorGerd Moellmann <gerd@gnu.org>
Fri, 18 Aug 2000 03:13:27 +0000 (03:13 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 18 Aug 2000 03:13:27 +0000 (03:13 +0000)
second half of a HELP_EVENT is found at the start of kbd_buffer.

src/keyboard.c

index 4d48c22f30e4fb11dec12d203b3b8e44b6a59906..97687aad09f1dd1dc139ded0892ad609423db7d9 100644 (file)
@@ -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)
        {