2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
+ * keyboard.c: Make symbols static if they're not exported.
+ (single_kboard, recent_keys_index, total_keys, recent_keys):
+ (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
+ (this_single_command_key_start, echoing, last_auto_save):
+ (read_key_sequence_cmd, dribble, recursive_edit_unwind):
+ (command_loop, echo_now, keyboard_init_hook, help_char_p):
+ (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
+ (Vlispy_mouse_stem, double_click_count):
+ Now static.
+ (force_auto_save_soon): Define only if SIGDANGER.
+ (ignore_mouse_drag_p): Now static if
+ !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
+ (print_help): Remove; unused.
+ (stop_character, last_timer_event): Mark as externally visible.
+ * keyboard.h (ignore_mouse_drag_p): Declare only if
+ defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
+ (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
+ * lisp.h (echoing): Remove decl.
+ (force_auto_save_soon): Declare only if SIGDANGER.
+ * xdisp.c (redisplay_window): Simplify code, to make it more
+ obvious that ignore_mouse_drag_p is not accessed if !defined
+ USE_GTK && !defined HAVE_NS.
+
* intervals.c: Make symbols static if they're not exported.
(merge_properties_sticky, merge_interval_right, delete_interval):
Now static.
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. */
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) \
/* 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;
/* 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;
static Lisp_Object Qinput_method_function;
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;
static Lisp_Object Qvertical_scroll_bar;
Lisp_Object Qmenu_bar;
-Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void);
+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);
static Lisp_Object Qpolling_period;
#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);
Lisp_Object, const char *const *,
Lisp_Object *, unsigned);
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);
#endif
INFUN (Fcommand_execute, 4);
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
DEFUE ("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.
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
/* 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);
/* Return 1 if should recognize C as "the help character". */
-int
+static int
help_char_p (Lisp_Object c)
{
Lisp_Object tail;
}
}
-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)
}
/* 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,
#endif /* not HAVE_NTGUI */
-Lisp_Object Vlispy_mouse_stem;
+static Lisp_Object Vlispy_mouse_stem;
static const char *const lispy_wheel_names[] =
{
/* 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. */
/* Handle a C-g by making read_char return C-g. */
-void
+static void
quit_throw_to_read_char (void)
{
sigfree ();
/* A list of all kboard objects, linked through next_kboard. */
extern KBOARD *all_kboards;
-
-/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
-extern int single_kboard;
\f
/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */
extern size_t num_input_events;
happens. */
extern EMACS_TIME *input_available_clear_time;
+#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
extern int ignore_mouse_drag_p;
+#endif
/* The primary selection. */
extern Lisp_Object QPRIMARY;
extern int menu_separator_name_p (const char *);
extern int parse_menu_item (Lisp_Object, int);
-extern void echo_now (void);
extern void init_kboard (KBOARD *);
extern void delete_kboard (KBOARD *);
extern void not_single_kboard_state (KBOARD *);
extern void stuff_buffered_input (Lisp_Object);
extern void clear_waiting_for_input (void);
extern void swallow_events (int);
-extern int help_char_p (Lisp_Object);
-extern void quit_throw_to_read_char (void) NO_RETURN;
extern int lucid_event_type_list_p (Lisp_Object);
extern void kbd_buffer_store_event (struct input_event *);
extern void kbd_buffer_store_event_hold (struct input_event *,