Subject: bug#29104: AW: bug#29104: [PATCH]: xterm-mouse-mode clicks in the modeline dont use the keymap properties of the modeline strings

From: "[email-masked]" <[email-masked]>
Date: Mon, 13 Nov 2017 14:57:54 +0100 (CET)

In a more radical approach and instead of my original patch, one can get rid off
with the variable first_event all together, see patch below. It simplifies the code
a little bit, but of course is more risky.

Olaf

diff --git a/src/keyboard.c b/src/keyboard.c
index ee353d2..8df43b8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -8916,7 +8916,6 @@ static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object,
   ptrdiff_t keys_start;
 
   Lisp_Object current_binding = Qnil;
-  Lisp_Object first_event = Qnil;
 
   /* Index of the first key that has no binding.
      It is useless to try fkey.start larger than that.  */
@@ -9032,7 +9031,7 @@ static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object,
      keybuf with its symbol, or if the sequence starts with a mouse
      click and we need to switch buffers, we jump back here to rebuild
      the initial keymaps from the current buffer.  */
-  current_binding = active_maps (first_event);
+  current_binding = active_maps (mock_input > 0 ? keybuf[0] : Qnil);
 
   /* Start from the beginning in keybuf.  */
   t = 0;
@@ -9279,10 +9278,9 @@ static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object,
                }
            }
 
-         if (NILP (first_event))
+         if (t == 0)
            {
-             first_event = key;
-             /* Even if first_event does not specify a particular
+             /* Even if key does not specify a particular
                 window/position, it's important to recompute the maps here
                 since a long time might have passed since we entered
                 read_key_sequence, and a timer (or process-filter or
@@ -9292,7 +9290,7 @@ static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object,
                  && (XBUFFER (XWINDOW (selected_window)->contents)
                      != current_buffer))
                Fset_buffer (XWINDOW (selected_window)->contents);
-             current_binding = active_maps (first_event);
+             current_binding = active_maps (key);
            }
 
          GROW_RAW_KEYBUF;

----------------------------------------------------------------
Gesendet mit Telekom Mail <https://t-online.de/email-kostenlos> - kostenlos und sicher für alle!