summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c54
1 files changed, 23 insertions, 31 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 5f136f03ecf..5fa58abce1d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2279,7 +2279,7 @@ read_decoded_event_from_main_queue (struct timespec *end_time,
eassert (coding->carryover_bytes == 0);
n = 0;
while (n < coding->produced_char)
- events[n++] = make_fixnum (STRING_CHAR_ADVANCE (p));
+ events[n++] = make_fixnum (string_char_advance (&p));
}
}
}
@@ -2901,6 +2901,12 @@ read_char (int commandflag, Lisp_Object map,
example banishing the mouse under mouse-avoidance-mode. */
timer_resume_idle ();
+#ifdef HAVE_NS
+ if (CONSP (c)
+ && (EQ (XCAR (c), intern ("ns-unput-working-text"))))
+ input_was_pending = input_pending;
+#endif
+
if (current_buffer != prev_buffer)
{
/* The command may have changed the keymaps. Pretend there
@@ -2921,13 +2927,11 @@ read_char (int commandflag, Lisp_Object map,
goto exit;
if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
- && UNSIGNED_CMP (XFIXNAT (c), <,
- SCHARS (KVAR (current_kboard,
- Vkeyboard_translate_table))))
+ && XFIXNAT (c) < SCHARS (KVAR (current_kboard,
+ Vkeyboard_translate_table)))
|| (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
- && UNSIGNED_CMP (XFIXNAT (c), <,
- ASIZE (KVAR (current_kboard,
- Vkeyboard_translate_table))))
+ && XFIXNAT (c) < ASIZE (KVAR (current_kboard,
+ Vkeyboard_translate_table)))
|| (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
&& CHARACTERP (c)))
{
@@ -5992,24 +5996,14 @@ make_lispy_event (struct input_event *event)
return list2 (Qselect_window, list1 (event->frame_or_window));
case TAB_BAR_EVENT:
- if (EQ (event->arg, event->frame_or_window))
- /* This is the prefix key. We translate this to
- `(tab_bar)' because the code in keyboard.c for tab bar
- events, which we use, relies on this. */
- return list1 (Qtab_bar);
- else if (SYMBOLP (event->arg))
- return apply_modifiers (event->modifiers, event->arg);
- return event->arg;
-
case TOOL_BAR_EVENT:
- if (EQ (event->arg, event->frame_or_window))
- /* This is the prefix key. We translate this to
- `(tool_bar)' because the code in keyboard.c for tool bar
- events, which we use, relies on this. */
- return list1 (Qtool_bar);
- else if (SYMBOLP (event->arg))
- return apply_modifiers (event->modifiers, event->arg);
- return event->arg;
+ {
+ Lisp_Object res = event->arg;
+ Lisp_Object location
+ = event->kind == TAB_BAR_EVENT ? Qtab_bar : Qtool_bar;
+ if (SYMBOLP (res)) res = apply_modifiers (event->modifiers, res);
+ return list2 (res, list2 (event->frame_or_window, location));
+ }
case USER_SIGNAL_EVENT:
/* A user signal. */
@@ -8308,7 +8302,7 @@ append_tab_bar_item (void)
/* Append entries from tab_bar_item_properties to the end of
tab_bar_items_vector. */
vcopy (tab_bar_items_vector, ntab_bar_items,
- XVECTOR (tab_bar_item_properties)->contents, TAB_BAR_ITEM_NSLOTS);
+ xvector_contents (tab_bar_item_properties), TAB_BAR_ITEM_NSLOTS);
ntab_bar_items += TAB_BAR_ITEM_NSLOTS;
}
@@ -8785,7 +8779,7 @@ append_tool_bar_item (void)
/* Append entries from tool_bar_item_properties to the end of
tool_bar_items_vector. */
vcopy (tool_bar_items_vector, ntool_bar_items,
- XVECTOR (tool_bar_item_properties)->contents, TOOL_BAR_ITEM_NSLOTS);
+ xvector_contents (tool_bar_item_properties), TOOL_BAR_ITEM_NSLOTS);
ntool_bar_items += TOOL_BAR_ITEM_NSLOTS;
}
@@ -10472,9 +10466,8 @@ Internal use only. */)
this_command_key_count = 0;
this_single_command_key_start = 0;
- int charidx = 0, byteidx = 0;
- int key0;
- FETCH_STRING_CHAR_ADVANCE (key0, keys, charidx, byteidx);
+ ptrdiff_t charidx = 0, byteidx = 0;
+ int key0 = fetch_string_char_advance (keys, &charidx, &byteidx);
if (CHAR_BYTE8_P (key0))
key0 = CHAR_TO_BYTE8 (key0);
@@ -10486,8 +10479,7 @@ Internal use only. */)
add_command_key (make_fixnum (key0));
for (ptrdiff_t i = 1; i < SCHARS (keys); i++)
{
- int key_i;
- FETCH_STRING_CHAR_ADVANCE (key_i, keys, charidx, byteidx);
+ int key_i = fetch_string_char_advance (keys, &charidx, &byteidx);
if (CHAR_BYTE8_P (key_i))
key_i = CHAR_TO_BYTE8 (key_i);
add_command_key (make_fixnum (key_i));