Commit 48011560 authored by Paul Eggert's avatar Paul Eggert
Browse files

* keyboard.c (read_key_sequence): Don't check last_real_key_start redundantly.

parent 32ad8845
......@@ -3,6 +3,7 @@
* keyboard.c (parse_modifiers_uncached, parse_modifiers):
Don't assume string length fits in int.
(keyremap_step, read_key_sequence): Use size_t for sizes.
(read_key_sequence): Don't check last_real_key_start redundantly.
 
* callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
instead of alloca (Bug#8344).
......@@ -9359,12 +9359,13 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt,
last_real_key_start = t - 1;
}
if (last_real_key_start == 0)
{
/* Key sequences beginning with mouse clicks are
read using the keymaps in the buffer clicked on,
not the current buffer. If we're at the
beginning of a key sequence, switch buffers. */
if (last_real_key_start == 0
&& WINDOWP (window)
if (WINDOWP (window)
&& BUFFERP (XWINDOW (window)->buffer)
&& XBUFFER (XWINDOW (window)->buffer) != current_buffer)
{
......@@ -9389,14 +9390,14 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt,
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
orig_local_map = get_local_map (PT, current_buffer,
Qlocal_map);
orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
orig_keymap = get_local_map (PT, current_buffer,
Qkeymap);
goto replay_sequence;
}
/* For a mouse click, get the local text-property keymap
of the place clicked on, rather than point. */
if (last_real_key_start == 0
&& CONSP (XCDR (key))
if (CONSP (XCDR (key))
&& ! localized_local_map)
{
Lisp_Object map_here, start, pos;
......@@ -9412,7 +9413,8 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt,
&& XINT (pos) <= ZV)
{
map_here = get_local_map (XINT (pos),
current_buffer, Qlocal_map);
current_buffer,
Qlocal_map);
if (!EQ (map_here, orig_local_map))
{
orig_local_map = map_here;
......@@ -9420,7 +9422,8 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt,
}
map_here = get_local_map (XINT (pos),
current_buffer, Qkeymap);
current_buffer,
Qkeymap);
if (!EQ (map_here, orig_keymap))
{
orig_keymap = map_here;
......@@ -9437,6 +9440,7 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt,
}
}
}
}
/* Expand mode-line and scroll-bar events into two events:
use posn as a fake prefix key. */
......
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