/* Last size recorded for a current buffer which is not a minibuffer. */
static EMACS_INT last_non_minibuf_size;
-/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */
-size_t num_input_events;
+/* Total number of times read_char has returned, modulo UINTMAX_MAX + 1. */
+uintmax_t num_input_events;
/* Value of num_nonmacro_input_events as of last auto save. */
#endif
static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object,
Lisp_Object, const char *const *,
- Lisp_Object *, unsigned);
+ Lisp_Object *, EMACS_INT);
static Lisp_Object make_lispy_switch_frame (Lisp_Object);
static int help_char_p (Lisp_Object);
static void save_getcjmp (jmp_buf);
message_with_string ("%s is undefined", keys, 0);
KVAR (current_kboard, defining_kbd_macro) = Qnil;
update_mode_lines = 1;
- KVAR (current_kboard, Vprefix_arg) = Qnil;
+ /* If this is a down-mouse event, don't reset prefix-arg;
+ pass it to the command run by the up event. */
+ if (EVENT_HAS_PARAMETERS (last_command_event))
+ {
+ Lisp_Object breakdown
+ = parse_modifiers (EVENT_HEAD (last_command_event));
+ int modifiers = XINT (XCAR (XCDR (breakdown)));
+ if (!(modifiers & down_modifier))
+ KVAR (current_kboard, Vprefix_arg) = Qnil;
+ }
+ else
+ KVAR (current_kboard, Vprefix_arg) = Qnil;
}
else
{
&& PT > BEGV && PT < ZV
&& !NILP (val = get_char_property_and_overlay
(make_number (PT), Qdisplay, Qnil, &overlay))
- && display_prop_intangible_p (val)
+ && display_prop_intangible_p (val, overlay, PT, PT_BYTE)
&& (!OVERLAYP (overlay)
? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil)
: (beg = OVERLAY_POSITION (OVERLAY_START (overlay)),
}
static Lisp_Object
-safe_run_hook_funcall (size_t nargs, Lisp_Object *args)
+safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args)
{
eassert (nargs == 1);
if (CONSP (Vinhibit_quit))
c = Faref (Vexecuting_kbd_macro, make_number (executing_kbd_macro_index));
if (STRINGP (Vexecuting_kbd_macro)
- && (XINT (c) & 0x80) && (XUINT (c) <= 0xff))
- XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80));
+ && (XFASTINT (c) & 0x80) && (XFASTINT (c) <= 0xff))
+ XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));
executing_kbd_macro_index++;
goto exit;
if ((STRINGP (KVAR (current_kboard, Vkeyboard_translate_table))
- && SCHARS (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
+ && UNSIGNED_CMP (XFASTINT (c), <,
+ SCHARS (KVAR (current_kboard,
+ Vkeyboard_translate_table))))
|| (VECTORP (KVAR (current_kboard, Vkeyboard_translate_table))
- && ASIZE (KVAR (current_kboard, Vkeyboard_translate_table)) > (unsigned) XFASTINT (c))
+ && UNSIGNED_CMP (XFASTINT (c), <,
+ ASIZE (KVAR (current_kboard,
+ Vkeyboard_translate_table))))
|| (CHAR_TABLE_P (KVAR (current_kboard, Vkeyboard_translate_table))
&& CHARACTERP (c)))
{
save the echo area contents for it to refer to. */
if (INTEGERP (c)
&& ! NILP (Vinput_method_function)
- && (unsigned) XINT (c) >= ' '
- && (unsigned) XINT (c) != 127
- && (unsigned) XINT (c) < 256)
+ && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127)
{
previous_echo_area_message = Fcurrent_message ();
Vinput_method_previous_message = previous_echo_area_message;
/* Don't run the input method within a key sequence,
after the first event of the key sequence. */
&& NILP (prev_event)
- && (unsigned) XINT (c) >= ' '
- && (unsigned) XINT (c) != 127
- && (unsigned) XINT (c) < 256)
+ && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127)
{
Lisp_Object keys;
int key_count, key_count_reset;
if (INTEGERP (c))
{
if (XUINT (c) < 0x100)
- putc (XINT (c), dribble);
+ putc (XUINT (c), dribble);
else
fprintf (dribble, " 0x%"pI"x", XUINT (c));
}
\f
/* Clear input event EVENT. */
-static INLINE void
+static inline void
clear_event (struct input_event *event)
{
event->kind = NO_EVENT;
Qfunction_key,
KVAR (current_kboard, Vsystem_key_alist),
0, &KVAR (current_kboard, system_key_syms),
- (unsigned) -1);
+ TYPE_MAXIMUM (EMACS_INT));
}
return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET,
Lisp_Object parsed;
parsed = parse_modifiers (symbol);
- return apply_modifiers ((int) XINT (XCAR (XCDR (parsed))),
+ return apply_modifiers (XFASTINT (XCAR (XCDR (parsed))),
XCAR (parsed));
}
static Lisp_Object
modify_event_symbol (EMACS_INT symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
Lisp_Object name_alist_or_stem, const char *const *name_table,
- Lisp_Object *symbol_table, unsigned int table_size)
+ Lisp_Object *symbol_table, EMACS_INT table_size)
{
Lisp_Object value;
Lisp_Object symbol_int;
if (CONSP (def))
{
menu_bar_one_keymap_changed_items = Qnil;
- map_keymap (def, menu_bar_item, Qnil, NULL, 1);
+ map_keymap_canonical (def, menu_bar_item, Qnil, NULL);
}
}
/* If we got no definition, this item is just unselectable text which
is OK in a submenu but not in the menubar. */
if (NILP (def))
- return (inmenubar ? 0 : 1);
+ return (!inmenubar);
/* See if this is a separate pane or a submenu. */
def = AREF (item_properties, ITEM_PROPERTY_DEF);
/* `:label LABEL-STRING'. */
PROP (TOOL_BAR_ITEM_LABEL) = STRINGP (value)
? value
- : make_string (bad_label, strlen (bad_label));
+ : build_string (bad_label);
have_label = 1;
}
else if (EQ (ikey, QCfilter))
else
label = "";
- new_lbl = Fupcase_initials (make_string (label, strlen (label)));
+ new_lbl = Fupcase_initials (build_string (label));
if (SCHARS (new_lbl) <= tool_bar_max_label_size)
PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
else
DEFUN ("open-dribble-file", Fopen_dribble_file, Sopen_dribble_file, 1, 1,
"FOpen dribble file: ",
doc: /* Start writing all keyboard characters to a dribble file called FILE.
-If FILE is nil, close any open dribble file. */)
+If FILE is nil, close any open dribble file.
+The file will be closed when Emacs exits. */)
(Lisp_Object file)
{
if (dribble)