KBOARD *initial_kboard;
KBOARD *current_kboard;
KBOARD *all_kboards;
-int single_kboard;
+
+/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
+static int single_kboard;
/* Non-nil disable property on a command means
do not execute it; call disabled-command-function's value instead. */
-Lisp_Object Qdisabled, Qdisabled_command_function;
+Lisp_Object Qdisabled;
+static Lisp_Object Qdisabled_command_function;
#define NUM_RECENT_KEYS (300)
-int recent_keys_index; /* Index for storing next element into recent_keys */
-int total_keys; /* Total number of elements stored into recent_keys */
-Lisp_Object recent_keys; /* Vector holds the last NUM_RECENT_KEYS keystrokes */
+
+/* Index for storing next element into recent_keys. */
+static int recent_keys_index;
+
+/* Total number of elements stored into recent_keys. */
+static int total_keys;
+
+/* This vector holds the last NUM_RECENT_KEYS keystrokes. */
+static Lisp_Object recent_keys;
/* Vector holding the key sequence that invoked the current command.
It is reused for each command, and it may be longer than the current
/* 1 after calling Freset_this_command_lengths.
Usually it is 0. */
-int this_command_key_count_reset;
+static int this_command_key_count_reset;
/* This vector is used as a buffer to record the events that were actually read
by read_key_sequence. */
-Lisp_Object raw_keybuf;
-int raw_keybuf_count;
+static Lisp_Object raw_keybuf;
+static int raw_keybuf_count;
#define GROW_RAW_KEYBUF \
- if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \
+ if (raw_keybuf_count == ASIZE (raw_keybuf)) \
raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil) \
/* Number of elements of this_command_keys
that precede this key sequence. */
-int this_single_command_key_start;
+static int this_single_command_key_start;
/* Record values of this_command_key_count and echo_length ()
before this command was read. */
/* True while displaying for echoing. Delays C-g throwing. */
-int echoing;
+static int echoing;
/* Non-null means we can start echoing at the next input pause even
though there is something in the echo area. */
/* Value of num_nonmacro_input_events as of last auto save. */
-int last_auto_save;
+static int last_auto_save;
/* This is like Vthis_command, except that commands never set it. */
Lisp_Object real_this_command;
/* The value of point when the last command was started. */
-EMACS_INT last_point_position;
+static EMACS_INT last_point_position;
/* The buffer that was current when the last command was started. */
-Lisp_Object last_point_position_buffer;
+static Lisp_Object last_point_position_buffer;
/* The window that was selected when the last command was started. */
-Lisp_Object last_point_position_window;
+static Lisp_Object last_point_position_window;
/* The frame in which the last input event occurred, or Qmacro if the
last event came from a macro. We use this to determine when to
/* The timestamp of the last input event we received from the X server.
X Windows wants this for selection ownership. */
-unsigned long last_event_timestamp;
+Time last_event_timestamp;
-Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame;
+static Lisp_Object Qx_set_selection, Qhandle_switch_frame;
+Lisp_Object QPRIMARY;
-Lisp_Object Qself_insert_command;
-Lisp_Object Qforward_char;
-Lisp_Object Qbackward_char;
+static Lisp_Object Qself_insert_command;
+static Lisp_Object Qforward_char;
+static Lisp_Object Qbackward_char;
Lisp_Object Qundefined;
-Lisp_Object Qtimer_event_handler;
+static Lisp_Object Qtimer_event_handler;
/* read_key_sequence stores here the command definition of the
key sequence that it reads. */
-Lisp_Object read_key_sequence_cmd;
+static Lisp_Object read_key_sequence_cmd;
-Lisp_Object Qinput_method_function;
+static Lisp_Object Qinput_method_function;
-Lisp_Object Qdeactivate_mark;
+static Lisp_Object Qdeactivate_mark;
Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook;
-Lisp_Object Qecho_area_clear_hook;
+static Lisp_Object Qecho_area_clear_hook;
/* Hooks to run before and after each command. */
-Lisp_Object Qpre_command_hook;
-Lisp_Object Qpost_command_hook;
+static Lisp_Object Qpre_command_hook;
+static Lisp_Object Qpost_command_hook;
+
+static Lisp_Object Qdeferred_action_function;
-Lisp_Object Qdeferred_action_function;
+static Lisp_Object Qdelayed_warnings_hook;
-Lisp_Object Qinput_method_exit_on_first_char;
-Lisp_Object Qinput_method_use_echo_area;
+static Lisp_Object Qinput_method_exit_on_first_char;
+static Lisp_Object Qinput_method_use_echo_area;
-Lisp_Object Qhelp_form_show;
+static Lisp_Object Qhelp_form_show;
/* File in which we write all commands we read. */
-FILE *dribble;
+static FILE *dribble;
/* Nonzero if input is available. */
int input_pending;
at inopportune times. */
/* Symbols to head events. */
-Lisp_Object Qmouse_movement;
-Lisp_Object Qscroll_bar_movement;
+static Lisp_Object Qmouse_movement;
+static Lisp_Object Qscroll_bar_movement;
Lisp_Object Qswitch_frame;
-Lisp_Object Qdelete_frame;
-Lisp_Object Qiconify_frame;
-Lisp_Object Qmake_frame_visible;
-Lisp_Object Qselect_window;
+static Lisp_Object Qdelete_frame;
+static Lisp_Object Qiconify_frame;
+static Lisp_Object Qmake_frame_visible;
+static Lisp_Object Qselect_window;
Lisp_Object Qhelp_echo;
#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
-Lisp_Object Qmouse_fixup_help_message;
+static Lisp_Object Qmouse_fixup_help_message;
#endif
/* Symbols to denote kinds of events. */
-Lisp_Object Qfunction_key;
+static Lisp_Object Qfunction_key;
Lisp_Object Qmouse_click;
#if defined (WINDOWSNT)
Lisp_Object Qlanguage_change;
#endif
-Lisp_Object Qdrag_n_drop;
-Lisp_Object Qsave_session;
+static Lisp_Object Qdrag_n_drop;
+static Lisp_Object Qsave_session;
#ifdef HAVE_DBUS
-Lisp_Object Qdbus_event;
+static Lisp_Object Qdbus_event;
#endif
-Lisp_Object Qconfig_changed_event;
+static Lisp_Object Qconfig_changed_event;
/* Lisp_Object Qmouse_movement; - also an event header */
/* Properties of event headers. */
Lisp_Object Qevent_kind;
-Lisp_Object Qevent_symbol_elements;
+static Lisp_Object Qevent_symbol_elements;
/* menu and tool bar item parts */
-Lisp_Object Qmenu_enable;
-Lisp_Object QCenable, QCvisible, QChelp, QCfilter, QCkeys, QCkey_sequence;
-Lisp_Object QCbutton, QCtoggle, QCradio, QClabel, QCvert_only;
+static Lisp_Object Qmenu_enable;
+static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence;
+Lisp_Object QCfilter;
+
+/* Non-nil disable property on a command means
+ do not execute it; call disabled-command-function's value instead. */
+Lisp_Object QCtoggle, QCradio;
+static Lisp_Object QCbutton, QClabel;
+
+static Lisp_Object QCvert_only;
/* An event header symbol HEAD may have a property named
Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
Qmodifier_cache, which is an alist mapping modifier masks onto
modified versions of BASE. If present, this helps speed up
apply_modifiers. */
-Lisp_Object Qmodifier_cache;
+static Lisp_Object Qmodifier_cache;
/* Symbols to use for parts of windows. */
Lisp_Object Qmode_line;
Lisp_Object Qvertical_line;
-Lisp_Object Qvertical_scroll_bar;
+static Lisp_Object Qvertical_scroll_bar;
Lisp_Object Qmenu_bar;
-Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void);
-Lisp_Object Fthis_command_keys (void);
-Lisp_Object Qextended_command_history;
+static Lisp_Object recursive_edit_unwind (Lisp_Object buffer);
+static Lisp_Object command_loop (void);
+static Lisp_Object Qextended_command_history;
EMACS_TIME timer_check (void);
static void record_menu_key (Lisp_Object c);
+static void echo_now (void);
static int echo_length (void);
-Lisp_Object Qpolling_period;
+static Lisp_Object Qpolling_period;
/* Incremented whenever a timer is run. */
int timers_run;
#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2)
/* Function for init_keyboard to call with no args (if nonzero). */
-void (*keyboard_init_hook) (void);
+static void (*keyboard_init_hook) (void);
static int read_avail_input (int);
static void get_input_pending (int *, int);
#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);
static void restore_getcjmp (jmp_buf);
static Lisp_Object apply_modifiers (int, Lisp_Object);
#ifdef SIGIO
static void input_available_signal (int signo);
#endif
+static Lisp_Object (Fcommand_execute) (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object);
static void handle_interrupt (void);
+static void quit_throw_to_read_char (void) NO_RETURN;
static void timer_start_idle (void);
static void timer_stop_idle (void);
static void timer_resume_idle (void);
/* Display the current echo string, and begin echoing if not already
doing so. */
-void
+static void
echo_now (void)
{
if (!current_kboard->immediate_echo)
/* Make an auto save happen as soon as possible at command level. */
+#ifdef SIGDANGER
void
force_auto_save_soon (void)
{
record_asynch_buffer_change ();
}
+#endif
\f
DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "",
doc: /* Invoke the editor command loop recursively.
}
\f
Lisp_Object command_loop_1 (void);
-Lisp_Object command_loop_2 (Lisp_Object);
-Lisp_Object top_level_1 (Lisp_Object);
+static Lisp_Object command_loop_2 (Lisp_Object);
+static Lisp_Object top_level_1 (Lisp_Object);
/* Entry to editor-command-loop.
This level has the catches for exiting/returning to editor command loop.
Fthrow (Qtop_level, Qnil);
}
-Lisp_Object Fexit_recursive_edit (void) NO_RETURN;
+static Lisp_Object Fexit_recursive_edit (void) NO_RETURN;
DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
doc: /* Exit from the innermost recursive edit or minibuffer. */)
(void)
error ("No recursive edit is in progress");
}
-Lisp_Object Fabort_recursive_edit (void) NO_RETURN;
+static Lisp_Object Fabort_recursive_edit (void) NO_RETURN;
DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
doc: /* Abort the command that requested this recursive edit or minibuffer input. */)
(void)
If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
after resizing the tool-bar window. */
+#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
+static
+#endif
int ignore_mouse_drag_p;
static FRAME_PTR
if (!NILP (echo_area_buffer[0]))
resize_echo_area_exactly ();
+ /* If there are warnings waiting, process them. */
+ if (!NILP (Vdelayed_warnings_list))
+ safe_run_hooks (Qdelayed_warnings_hook);
+
if (!NILP (Vdeferred_action_list))
safe_run_hooks (Qdeferred_action_function);
}
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
{
if (!NILP (echo_area_buffer[0]))
resize_echo_area_exactly ();
+ /* If there are warnings waiting, process them. */
+ if (!NILP (Vdelayed_warnings_list))
+ safe_run_hooks (Qdelayed_warnings_hook);
+
safe_run_hooks (Qdeferred_action_function);
/* If there is a prefix argument,
&& 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))
/* Asynchronous timer for polling. */
-struct atimer *poll_timer;
+static struct atimer *poll_timer;
#ifdef POLL_FOR_INPUT
\f
/* Input of single characters from keyboard */
-Lisp_Object print_help (Lisp_Object object);
static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
struct timeval *end_time);
static void record_char (Lisp_Object c);
volatile Lisp_Object also_record;
volatile int reread;
struct gcpro gcpro1, gcpro2;
- int polling_stopped_here = 0;
+ int volatile polling_stopped_here = 0;
struct kboard *orig_kboard = current_kboard;
also_record = Qnil;
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))
- && XVECTOR (KVAR (current_kboard, Vkeyboard_translate_table))->size > (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;
/* Return 1 if should recognize C as "the help character". */
-int
+static int
help_char_p (Lisp_Object c)
{
Lisp_Object tail;
if (INTEGERP (c))
{
if (XUINT (c) < 0x100)
- putc (XINT (c), dribble);
+ putc (XUINT (c), dribble);
else
- fprintf (dribble, " 0x%x", (int) XUINT (c));
+ fprintf (dribble, " 0x%"pI"x", XUINT (c));
}
else
{
}
}
-Lisp_Object
-print_help (Lisp_Object object)
-{
- struct buffer *old = current_buffer;
- Fprinc (object, Qnil);
- set_buffer_internal (XBUFFER (Vstandard_output));
- call0 (intern ("help-mode"));
- set_buffer_internal (old);
- return Qnil;
-}
-
/* Copy out or in the info on where C-g should throw to.
This is used when running Lisp code from within get_char,
in case get_char is called recursively.
}
/* Set this for debugging, to have a way to get out */
-int stop_character;
+int stop_character EXTERNALLY_VISIBLE;
static KBOARD *
event_to_kboard (struct input_event *event)
\f
/* Clear input event EVENT. */
-static INLINE void
+static inline void
clear_event (struct input_event *event)
{
event->kind = NO_EVENT;
Lisp_Object bar_window;
enum scroll_bar_part part;
Lisp_Object x, y;
- unsigned long t;
+ Time t;
*kbp = current_kboard;
/* Note that this uses F to determine which terminal to look at.
timer = XCAR (timers);
- if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
continue;
XVECTOR (timer)->contents[0] = Qnil;
}
}
/* This is only for debugging. */
-struct input_event last_timer_event;
+struct input_event last_timer_event EXTERNALLY_VISIBLE;
/* List of elisp functions to call, delayed because they were generated in
a context where Elisp could not be safely run (e.g. redisplay, signal,
if (CONSP (timers))
{
timer = XCAR (timers);
- if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
{
timers = XCDR (timers);
continue;
if (CONSP (idle_timers))
{
timer = XCAR (idle_timers);
- if (!VECTORP (timer) || XVECTOR (timer)->size != 8)
+ if (!VECTORP (timer) || ASIZE (timer) != 8)
{
idle_timers = XCDR (idle_timers);
continue;
#endif /* not HAVE_NTGUI */
-Lisp_Object Vlispy_mouse_stem;
+static Lisp_Object Vlispy_mouse_stem;
static const char *const lispy_wheel_names[] =
{
};
/* Scroll bar parts. */
-Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
-Lisp_Object Qup, Qdown, Qbottom, Qend_scroll;
-Lisp_Object Qtop, Qratio;
+static Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
+Lisp_Object Qup, Qdown, Qbottom;
+static Lisp_Object Qend_scroll;
+Lisp_Object Qtop;
+static Lisp_Object Qratio;
/* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */
static Lisp_Object *const scroll_bar_parts[] = {
static int last_mouse_button;
static int last_mouse_x;
static int last_mouse_y;
-static unsigned long button_down_time;
+static Time button_down_time;
/* The number of clicks in this multiple-click. */
-int double_click_count;
+static int double_click_count;
/* X and Y are frame-relative coordinates for a click or wheel event.
Return a Lisp-style event list. */
static Lisp_Object
make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
- unsigned long t)
+ Time t)
{
enum window_part part;
Lisp_Object posn = Qnil;
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,
&& (event->modifiers & down_modifier))
{
Lisp_Object items, item;
- int i;
/* Find the menu bar item under `column'. */
item = Qnil;
items = FRAME_MENU_BAR_ITEMS (f);
- for (i = 0; i < XVECTOR (items)->size; i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object pos, string;
string = AREF (items, i + 1);
&& (eabs (XINT (event->y) - last_mouse_y) <= fuzz)
&& button_down_time != 0
&& (EQ (Vdouble_click_time, Qt)
- || (INTEGERP (Vdouble_click_time)
- && ((int)(event->timestamp - button_down_time)
- < XINT (Vdouble_click_time)))));
+ || (NATNUMP (Vdouble_click_time)
+ && (event->timestamp - button_down_time
+ < XFASTINT (Vdouble_click_time)))));
}
last_mouse_button = button;
Qmouse_click, Vlispy_mouse_stem,
NULL,
&mouse_syms,
- XVECTOR (mouse_syms)->size);
+ ASIZE (mouse_syms));
if (event->modifiers & drag_modifier)
return Fcons (head,
Fcons (start_pos,
&& (eabs (XINT (event->y) - last_mouse_y) <= fuzz)
&& button_down_time != 0
&& (EQ (Vdouble_click_time, Qt)
- || (INTEGERP (Vdouble_click_time)
- && ((int)(event->timestamp - button_down_time)
- < XINT (Vdouble_click_time)))));
+ || (NATNUMP (Vdouble_click_time)
+ && (event->timestamp - button_down_time
+ < XFASTINT (Vdouble_click_time)))));
if (is_double)
{
double_click_count++;
Qmouse_click,
Vlispy_mouse_stem,
NULL, &mouse_syms,
- XVECTOR (mouse_syms)->size);
+ ASIZE (mouse_syms));
return Fcons (head, Fcons (position, Qnil));
}
Qmouse_click, Vlispy_mouse_stem,
NULL,
&mouse_syms,
- XVECTOR (mouse_syms)->size);
+ ASIZE (mouse_syms));
if (event->modifiers & drag_modifier)
return Fcons (head,
static Lisp_Object
make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part,
- Lisp_Object x, Lisp_Object y, unsigned long t)
+ Lisp_Object x, Lisp_Object y, Time t)
{
/* Is it a scroll bar movement? */
if (frame && ! NILP (bar_window))
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;
else
{
if (! VECTORP (*symbol_table)
- || XVECTOR (*symbol_table)->size != table_size)
+ || ASIZE (*symbol_table) != table_size)
{
Lisp_Object size;
{
int len = SBYTES (name_alist_or_stem);
char *buf = (char *) alloca (len + 50);
- sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
- (long) XINT (symbol_int) + 1);
+ sprintf (buf, "%s-%"pI"d", SDATA (name_alist_or_stem),
+ XINT (symbol_int) + 1);
value = intern (buf);
}
else if (name_table != 0 && name_table[symbol_num])
if (NILP (value))
{
char buf[20];
- sprintf (buf, "key-%ld", (long)symbol_num);
+ sprintf (buf, "key-%"pI"d", symbol_num);
value = intern (buf);
}
{
int old_errno = errno;
struct user_signal_info *p;
+ const char *special_event_name = NULL;
SIGNAL_THREAD_CHECK (sig);
+ if (SYMBOLP (Vdebug_on_event))
+ special_event_name = SSDATA (SYMBOL_NAME (Vdebug_on_event));
+
for (p = user_signals; p; p = p->next)
if (p->sig == sig)
{
+ if (special_event_name &&
+ strcmp (special_event_name, p->name) == 0)
+ {
+ /* Enter the debugger in many ways. */
+ debug_on_next_call = 1;
+ debug_on_quit = 1;
+ Vquit_flag = Qt;
+ Vinhibit_quit = Qnil;
+
+ /* Eat the event. */
+ break;
+ }
+
p->npending++;
#ifdef SIGIO
if (interrupt_input)
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);
}
}
/* Add nil, nil, nil, nil at the end. */
{
int i = menu_bar_items_index;
- if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
+ if (i + 4 > ASIZE (menu_bar_items_vector))
menu_bar_items_vector =
larger_vector (menu_bar_items_vector, 2 * i, Qnil);
/* Add this item. */
if (i == menu_bar_items_index)
{
/* If vector is too small, get a bigger one. */
- if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
+ if (i + 4 > ASIZE (menu_bar_items_vector))
menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil);
/* Add this item. */
XVECTOR (menu_bar_items_vector)->contents[i++] = key;
/* 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);
/* The symbols `:image' and `:rtl'. */
-Lisp_Object QCimage;
-Lisp_Object Qrtl;
+static Lisp_Object QCimage;
+static Lisp_Object QCrtl;
/* Function prototypes. */
/* `: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 if (EQ (ikey, QCimage)
&& (CONSP (value)
- || (VECTORP (value) && XVECTOR (value)->size == 4)))
+ || (VECTORP (value) && ASIZE (value) == 4)))
/* Value is either a single image specification or a vector
of 4 such specifications for the different button states. */
PROP (TOOL_BAR_ITEM_IMAGES) = value;
- else if (EQ (ikey, Qrtl))
+ else if (EQ (ikey, QCrtl))
/* ':rtl STRING' */
PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
}
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
PROP (TOOL_BAR_ITEM_LABEL) = make_string ("", 0);
- free (buf);
+ xfree (buf);
}
/* If got a filter apply it on binding. */
/* Enlarge tool_bar_items_vector if necessary. */
if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS
- >= XVECTOR (tool_bar_items_vector)->size)
+ >= ASIZE (tool_bar_items_vector))
tool_bar_items_vector
= larger_vector (tool_bar_items_vector,
- 2 * XVECTOR (tool_bar_items_vector)->size, Qnil);
+ 2 * ASIZE (tool_bar_items_vector), Qnil);
/* Append entries from tool_bar_item_properties to the end of
tool_bar_items_vector. */
}
/* Move past this element. */
- if (idx >= 0 && idx + 1 >= XVECTOR (vector)->size)
+ if (idx >= 0 && idx + 1 >= ASIZE (vector))
/* Handle reaching end of dense table. */
idx = -1;
if (idx >= 0)
/* Treat uppercase keys as shifted. */
|| (INTEGERP (key)
&& (KEY_TO_CHAR (key)
- < XCHAR_TABLE (BVAR (current_buffer, downcase_table))->size)
+ < XCHAR_TABLE (BVAR (current_buffer, downcase_table))->header.size)
&& uppercasep (KEY_TO_CHAR (key))))
{
Lisp_Object new_key
this_single_command_key_start = 0;
keys = XVECTOR (saved_keys)->contents;
- for (i = 0; i < XVECTOR (saved_keys)->size; i++)
+ for (i = 0; i < ASIZE (saved_keys); i++)
add_command_key (keys[i]);
for (i = 0; i < SCHARS (function); i++)
if (NILP (keep_record))
{
- for (i = 0; i < XVECTOR (recent_keys)->size; ++i)
+ for (i = 0; i < ASIZE (recent_keys); ++i)
XVECTOR (recent_keys)->contents[i] = Qnil;
total_keys = 0;
recent_keys_index = 0;
/* Handle a C-g by making read_char return C-g. */
-void
+static void
quit_throw_to_read_char (void)
{
sigfree ();
_longjmp (getcjmp, 1);
}
\f
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, Sset_input_interrupt_mode, 1, 1, 0,
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,
+ Sset_input_interrupt_mode, 1, 1, 0,
doc: /* Set interrupt mode of reading keyboard input.
If INTERRUPT is non-nil, Emacs will use input interrupts;
otherwise Emacs uses CBREAK mode.
/* Tool-bars. */
DEFSYM (QCimage, ":image");
DEFSYM (Qhelp_echo, "help-echo");
- DEFSYM (Qrtl, ":rtl");
+ DEFSYM (QCrtl, ":rtl");
staticpro (&item_properties);
item_properties = Qnil;
DEFSYM (Qpre_command_hook, "pre-command-hook");
DEFSYM (Qpost_command_hook, "post-command-hook");
DEFSYM (Qdeferred_action_function, "deferred-action-function");
+ DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook");
DEFSYM (Qfunction_key, "function-key");
DEFSYM (Qmouse_click, "mouse-click");
DEFSYM (Qdrag_n_drop, "drag-n-drop");
whenever `deferred-action-list' is non-nil. */);
Vdeferred_action_function = Qnil;
+ DEFVAR_LISP ("delayed-warnings-list", Vdelayed_warnings_list,
+ doc: /* List of warnings to be displayed as soon as possible.
+Each element must be a list (TYPE MESSAGE [LEVEL [BUFFER-NAME]]),
+as per the args of `display-warning' (which see).
+If this variable is non-nil, `delayed-warnings-hook' will be run
+immediately after running `post-command-hook'. */);
+ Vdelayed_warnings_list = Qnil;
+
DEFVAR_LISP ("suggest-key-bindings", Vsuggest_key_bindings,
doc: /* *Non-nil means show the equivalent key-binding when M-x command has one.
The value can be a length of time to show the message for.
`deactivate-mark' call uses this to set the window selection. */);
Vsaved_region_selection = Qnil;
+ DEFVAR_LISP ("debug-on-event",
+ Vdebug_on_event,
+ doc: /* Enter debugger on this event. When Emacs
+receives the special event specifed by this variable, it will try to
+break into the debugger as soon as possible instead of processing the
+event normally through `special-event-map'.
+
+Currently, the only supported values for this
+variable are `sigusr1' and `sigusr2'. */);
+ Vdebug_on_event = intern_c_string ("sigusr2");
+
/* Create the initial keyboard. */
initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
init_kboard (initial_kboard);