aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog23
-rw-r--r--src/keyboard.c77
-rw-r--r--src/keyboard.h8
-rw-r--r--src/lisp.h3
-rw-r--r--src/xdisp.c17
5 files changed, 75 insertions, 53 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2187a6b5620..322e3665e86 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,28 @@
12011-04-14 Paul Eggert <eggert@cs.ucla.edu> 12011-04-14 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * keyboard.c: Make symbols static if they're not exported.
4 (single_kboard, recent_keys_index, total_keys, recent_keys):
5 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
6 (this_single_command_key_start, echoing, last_auto_save):
7 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
8 (command_loop, echo_now, keyboard_init_hook, help_char_p):
9 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10 (Vlispy_mouse_stem, double_click_count):
11 Now static.
12 (force_auto_save_soon): Define only if SIGDANGER.
13 (ignore_mouse_drag_p): Now static if
14 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15 (print_help): Remove; unused.
16 (stop_character, last_timer_event): Mark as externally visible.
17 * keyboard.h (ignore_mouse_drag_p): Declare only if
18 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20 * lisp.h (echoing): Remove decl.
21 (force_auto_save_soon): Declare only if SIGDANGER.
22 * xdisp.c (redisplay_window): Simplify code, to make it more
23 obvious that ignore_mouse_drag_p is not accessed if !defined
24 USE_GTK && !defined HAVE_NS.
25
3 * intervals.c: Make symbols static if they're not exported. 26 * intervals.c: Make symbols static if they're not exported.
4 (merge_properties_sticky, merge_interval_right, delete_interval): 27 (merge_properties_sticky, merge_interval_right, delete_interval):
5 Now static. 28 Now static.
diff --git a/src/keyboard.c b/src/keyboard.c
index 92a44de6dae..1e673c493b6 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -96,7 +96,9 @@ int pending_signals;
96KBOARD *initial_kboard; 96KBOARD *initial_kboard;
97KBOARD *current_kboard; 97KBOARD *current_kboard;
98KBOARD *all_kboards; 98KBOARD *all_kboards;
99int single_kboard; 99
100/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
101static int single_kboard;
100 102
101/* Non-nil disable property on a command means 103/* Non-nil disable property on a command means
102 do not execute it; call disabled-command-function's value instead. */ 104 do not execute it; call disabled-command-function's value instead. */
@@ -104,9 +106,15 @@ Lisp_Object Qdisabled;
104static Lisp_Object Qdisabled_command_function; 106static Lisp_Object Qdisabled_command_function;
105 107
106#define NUM_RECENT_KEYS (300) 108#define NUM_RECENT_KEYS (300)
107int recent_keys_index; /* Index for storing next element into recent_keys */ 109
108int total_keys; /* Total number of elements stored into recent_keys */ 110/* Index for storing next element into recent_keys. */
109Lisp_Object recent_keys; /* Vector holds the last NUM_RECENT_KEYS keystrokes */ 111static int recent_keys_index;
112
113/* Total number of elements stored into recent_keys. */
114static int total_keys;
115
116/* This vector holds the last NUM_RECENT_KEYS keystrokes. */
117static Lisp_Object recent_keys;
110 118
111/* Vector holding the key sequence that invoked the current command. 119/* Vector holding the key sequence that invoked the current command.
112 It is reused for each command, and it may be longer than the current 120 It is reused for each command, and it may be longer than the current
@@ -118,12 +126,12 @@ int this_command_key_count;
118 126
119/* 1 after calling Freset_this_command_lengths. 127/* 1 after calling Freset_this_command_lengths.
120 Usually it is 0. */ 128 Usually it is 0. */
121int this_command_key_count_reset; 129static int this_command_key_count_reset;
122 130
123/* This vector is used as a buffer to record the events that were actually read 131/* This vector is used as a buffer to record the events that were actually read
124 by read_key_sequence. */ 132 by read_key_sequence. */
125Lisp_Object raw_keybuf; 133static Lisp_Object raw_keybuf;
126int raw_keybuf_count; 134static int raw_keybuf_count;
127 135
128#define GROW_RAW_KEYBUF \ 136#define GROW_RAW_KEYBUF \
129 if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \ 137 if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \
@@ -131,7 +139,7 @@ int raw_keybuf_count;
131 139
132/* Number of elements of this_command_keys 140/* Number of elements of this_command_keys
133 that precede this key sequence. */ 141 that precede this key sequence. */
134int this_single_command_key_start; 142static int this_single_command_key_start;
135 143
136/* Record values of this_command_key_count and echo_length () 144/* Record values of this_command_key_count and echo_length ()
137 before this command was read. */ 145 before this command was read. */
@@ -147,7 +155,7 @@ int waiting_for_input;
147 155
148/* True while displaying for echoing. Delays C-g throwing. */ 156/* True while displaying for echoing. Delays C-g throwing. */
149 157
150int echoing; 158static int echoing;
151 159
152/* Non-null means we can start echoing at the next input pause even 160/* Non-null means we can start echoing at the next input pause even
153 though there is something in the echo area. */ 161 though there is something in the echo area. */
@@ -207,7 +215,7 @@ size_t num_input_events;
207 215
208/* Value of num_nonmacro_input_events as of last auto save. */ 216/* Value of num_nonmacro_input_events as of last auto save. */
209 217
210int last_auto_save; 218static int last_auto_save;
211 219
212/* This is like Vthis_command, except that commands never set it. */ 220/* This is like Vthis_command, except that commands never set it. */
213Lisp_Object real_this_command; 221Lisp_Object real_this_command;
@@ -243,7 +251,7 @@ static Lisp_Object Qtimer_event_handler;
243 251
244/* read_key_sequence stores here the command definition of the 252/* read_key_sequence stores here the command definition of the
245 key sequence that it reads. */ 253 key sequence that it reads. */
246Lisp_Object read_key_sequence_cmd; 254static Lisp_Object read_key_sequence_cmd;
247 255
248static Lisp_Object Qinput_method_function; 256static Lisp_Object Qinput_method_function;
249 257
@@ -265,7 +273,7 @@ static Lisp_Object Qinput_method_use_echo_area;
265static Lisp_Object Qhelp_form_show; 273static Lisp_Object Qhelp_form_show;
266 274
267/* File in which we write all commands we read. */ 275/* File in which we write all commands we read. */
268FILE *dribble; 276static FILE *dribble;
269 277
270/* Nonzero if input is available. */ 278/* Nonzero if input is available. */
271int input_pending; 279int input_pending;
@@ -358,11 +366,13 @@ Lisp_Object Qvertical_line;
358static Lisp_Object Qvertical_scroll_bar; 366static Lisp_Object Qvertical_scroll_bar;
359Lisp_Object Qmenu_bar; 367Lisp_Object Qmenu_bar;
360 368
361Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void); 369static Lisp_Object recursive_edit_unwind (Lisp_Object buffer);
370static Lisp_Object command_loop (void);
362static Lisp_Object Qextended_command_history; 371static Lisp_Object Qextended_command_history;
363EMACS_TIME timer_check (void); 372EMACS_TIME timer_check (void);
364 373
365static void record_menu_key (Lisp_Object c); 374static void record_menu_key (Lisp_Object c);
375static void echo_now (void);
366static int echo_length (void); 376static int echo_length (void);
367 377
368static Lisp_Object Qpolling_period; 378static Lisp_Object Qpolling_period;
@@ -418,7 +428,7 @@ static EMACS_TIME timer_last_idleness_start_time;
418#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2) 428#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2)
419 429
420/* Function for init_keyboard to call with no args (if nonzero). */ 430/* Function for init_keyboard to call with no args (if nonzero). */
421void (*keyboard_init_hook) (void); 431static void (*keyboard_init_hook) (void);
422 432
423static int read_avail_input (int); 433static int read_avail_input (int);
424static void get_input_pending (int *, int); 434static void get_input_pending (int *, int);
@@ -438,6 +448,7 @@ static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object,
438 Lisp_Object, const char *const *, 448 Lisp_Object, const char *const *,
439 Lisp_Object *, unsigned); 449 Lisp_Object *, unsigned);
440static Lisp_Object make_lispy_switch_frame (Lisp_Object); 450static Lisp_Object make_lispy_switch_frame (Lisp_Object);
451static int help_char_p (Lisp_Object);
441static void save_getcjmp (jmp_buf); 452static void save_getcjmp (jmp_buf);
442static void restore_getcjmp (jmp_buf); 453static void restore_getcjmp (jmp_buf);
443static Lisp_Object apply_modifiers (int, Lisp_Object); 454static Lisp_Object apply_modifiers (int, Lisp_Object);
@@ -449,6 +460,7 @@ static void input_available_signal (int signo);
449#endif 460#endif
450INFUN (Fcommand_execute, 4); 461INFUN (Fcommand_execute, 4);
451static void handle_interrupt (void); 462static void handle_interrupt (void);
463static void quit_throw_to_read_char (void) NO_RETURN;
452static void timer_start_idle (void); 464static void timer_start_idle (void);
453static void timer_stop_idle (void); 465static void timer_stop_idle (void);
454static void timer_resume_idle (void); 466static void timer_resume_idle (void);
@@ -592,7 +604,7 @@ echo_dash (void)
592/* Display the current echo string, and begin echoing if not already 604/* Display the current echo string, and begin echoing if not already
593 doing so. */ 605 doing so. */
594 606
595void 607static void
596echo_now (void) 608echo_now (void)
597{ 609{
598 if (!current_kboard->immediate_echo) 610 if (!current_kboard->immediate_echo)
@@ -759,6 +771,7 @@ record_auto_save (void)
759 771
760/* Make an auto save happen as soon as possible at command level. */ 772/* Make an auto save happen as soon as possible at command level. */
761 773
774#ifdef SIGDANGER
762void 775void
763force_auto_save_soon (void) 776force_auto_save_soon (void)
764{ 777{
@@ -766,6 +779,7 @@ force_auto_save_soon (void)
766 779
767 record_asynch_buffer_change (); 780 record_asynch_buffer_change ();
768} 781}
782#endif
769 783
770DEFUE ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "", 784DEFUE ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "",
771 doc: /* Invoke the editor command loop recursively. 785 doc: /* Invoke the editor command loop recursively.
@@ -1088,8 +1102,8 @@ cmd_error_internal (Lisp_Object data, const char *context)
1088} 1102}
1089 1103
1090Lisp_Object command_loop_1 (void); 1104Lisp_Object command_loop_1 (void);
1091Lisp_Object command_loop_2 (Lisp_Object); 1105static Lisp_Object command_loop_2 (Lisp_Object);
1092Lisp_Object top_level_1 (Lisp_Object); 1106static Lisp_Object top_level_1 (Lisp_Object);
1093 1107
1094/* Entry to editor-command-loop. 1108/* Entry to editor-command-loop.
1095 This level has the catches for exiting/returning to editor command loop. 1109 This level has the catches for exiting/returning to editor command loop.
@@ -1253,6 +1267,9 @@ usage: (track-mouse BODY...) */)
1253 If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement 1267 If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
1254 after resizing the tool-bar window. */ 1268 after resizing the tool-bar window. */
1255 1269
1270#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
1271static
1272#endif
1256int ignore_mouse_drag_p; 1273int ignore_mouse_drag_p;
1257 1274
1258static FRAME_PTR 1275static FRAME_PTR
@@ -1910,7 +1927,7 @@ int poll_suppress_count;
1910 1927
1911/* Asynchronous timer for polling. */ 1928/* Asynchronous timer for polling. */
1912 1929
1913struct atimer *poll_timer; 1930static struct atimer *poll_timer;
1914 1931
1915 1932
1916#ifdef POLL_FOR_INPUT 1933#ifdef POLL_FOR_INPUT
@@ -2177,7 +2194,6 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
2177 2194
2178/* Input of single characters from keyboard */ 2195/* Input of single characters from keyboard */
2179 2196
2180Lisp_Object print_help (Lisp_Object object);
2181static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu, 2197static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
2182 struct timeval *end_time); 2198 struct timeval *end_time);
2183static void record_char (Lisp_Object c); 2199static void record_char (Lisp_Object c);
@@ -3171,7 +3187,7 @@ record_menu_key (Lisp_Object c)
3171 3187
3172/* Return 1 if should recognize C as "the help character". */ 3188/* Return 1 if should recognize C as "the help character". */
3173 3189
3174int 3190static int
3175help_char_p (Lisp_Object c) 3191help_char_p (Lisp_Object c)
3176{ 3192{
3177 Lisp_Object tail; 3193 Lisp_Object tail;
@@ -3320,17 +3336,6 @@ record_char (Lisp_Object c)
3320 } 3336 }
3321} 3337}
3322 3338
3323Lisp_Object
3324print_help (Lisp_Object object)
3325{
3326 struct buffer *old = current_buffer;
3327 Fprinc (object, Qnil);
3328 set_buffer_internal (XBUFFER (Vstandard_output));
3329 call0 (intern ("help-mode"));
3330 set_buffer_internal (old);
3331 return Qnil;
3332}
3333
3334/* Copy out or in the info on where C-g should throw to. 3339/* Copy out or in the info on where C-g should throw to.
3335 This is used when running Lisp code from within get_char, 3340 This is used when running Lisp code from within get_char,
3336 in case get_char is called recursively. 3341 in case get_char is called recursively.
@@ -3422,7 +3427,7 @@ readable_events (int flags)
3422} 3427}
3423 3428
3424/* Set this for debugging, to have a way to get out */ 3429/* Set this for debugging, to have a way to get out */
3425int stop_character; 3430int stop_character EXTERNALLY_VISIBLE;
3426 3431
3427static KBOARD * 3432static KBOARD *
3428event_to_kboard (struct input_event *event) 3433event_to_kboard (struct input_event *event)
@@ -4218,7 +4223,7 @@ timer_resume_idle (void)
4218} 4223}
4219 4224
4220/* This is only for debugging. */ 4225/* This is only for debugging. */
4221struct input_event last_timer_event; 4226struct input_event last_timer_event EXTERNALLY_VISIBLE;
4222 4227
4223/* List of elisp functions to call, delayed because they were generated in 4228/* List of elisp functions to call, delayed because they were generated in
4224 a context where Elisp could not be safely run (e.g. redisplay, signal, 4229 a context where Elisp could not be safely run (e.g. redisplay, signal,
@@ -5026,7 +5031,7 @@ static const char *const iso_lispy_function_keys[] =
5026 5031
5027#endif /* not HAVE_NTGUI */ 5032#endif /* not HAVE_NTGUI */
5028 5033
5029Lisp_Object Vlispy_mouse_stem; 5034static Lisp_Object Vlispy_mouse_stem;
5030 5035
5031static const char *const lispy_wheel_names[] = 5036static const char *const lispy_wheel_names[] =
5032{ 5037{
@@ -5076,7 +5081,7 @@ static unsigned long button_down_time;
5076 5081
5077/* The number of clicks in this multiple-click. */ 5082/* The number of clicks in this multiple-click. */
5078 5083
5079int double_click_count; 5084static int double_click_count;
5080 5085
5081/* X and Y are frame-relative coordinates for a click or wheel event. 5086/* X and Y are frame-relative coordinates for a click or wheel event.
5082 Return a Lisp-style event list. */ 5087 Return a Lisp-style event list. */
@@ -10945,7 +10950,7 @@ handle_interrupt (void)
10945 10950
10946/* Handle a C-g by making read_char return C-g. */ 10951/* Handle a C-g by making read_char return C-g. */
10947 10952
10948void 10953static void
10949quit_throw_to_read_char (void) 10954quit_throw_to_read_char (void)
10950{ 10955{
10951 sigfree (); 10956 sigfree ();
diff --git a/src/keyboard.h b/src/keyboard.h
index d945de5de20..1f5cbd23639 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -190,9 +190,6 @@ extern KBOARD *current_kboard;
190 190
191/* A list of all kboard objects, linked through next_kboard. */ 191/* A list of all kboard objects, linked through next_kboard. */
192extern KBOARD *all_kboards; 192extern KBOARD *all_kboards;
193
194/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
195extern int single_kboard;
196 193
197/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */ 194/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */
198extern size_t num_input_events; 195extern size_t num_input_events;
@@ -429,7 +426,9 @@ extern int waiting_for_input;
429 happens. */ 426 happens. */
430extern EMACS_TIME *input_available_clear_time; 427extern EMACS_TIME *input_available_clear_time;
431 428
429#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
432extern int ignore_mouse_drag_p; 430extern int ignore_mouse_drag_p;
431#endif
433 432
434/* The primary selection. */ 433/* The primary selection. */
435extern Lisp_Object QPRIMARY; 434extern Lisp_Object QPRIMARY;
@@ -469,7 +468,6 @@ extern int timers_run;
469extern int menu_separator_name_p (const char *); 468extern int menu_separator_name_p (const char *);
470extern int parse_menu_item (Lisp_Object, int); 469extern int parse_menu_item (Lisp_Object, int);
471 470
472extern void echo_now (void);
473extern void init_kboard (KBOARD *); 471extern void init_kboard (KBOARD *);
474extern void delete_kboard (KBOARD *); 472extern void delete_kboard (KBOARD *);
475extern void not_single_kboard_state (KBOARD *); 473extern void not_single_kboard_state (KBOARD *);
@@ -491,8 +489,6 @@ extern int make_ctrl_char (int);
491extern void stuff_buffered_input (Lisp_Object); 489extern void stuff_buffered_input (Lisp_Object);
492extern void clear_waiting_for_input (void); 490extern void clear_waiting_for_input (void);
493extern void swallow_events (int); 491extern void swallow_events (int);
494extern int help_char_p (Lisp_Object);
495extern void quit_throw_to_read_char (void) NO_RETURN;
496extern int lucid_event_type_list_p (Lisp_Object); 492extern int lucid_event_type_list_p (Lisp_Object);
497extern void kbd_buffer_store_event (struct input_event *); 493extern void kbd_buffer_store_event (struct input_event *);
498extern void kbd_buffer_store_event_hold (struct input_event *, 494extern void kbd_buffer_store_event_hold (struct input_event *,
diff --git a/src/lisp.h b/src/lisp.h
index 447fea7e8a7..460563fe4c1 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3093,7 +3093,6 @@ extern void syms_of_casetab (void);
3093 3093
3094/* Defined in keyboard.c */ 3094/* Defined in keyboard.c */
3095 3095
3096extern int echoing;
3097extern Lisp_Object echo_message_buffer; 3096extern Lisp_Object echo_message_buffer;
3098extern struct kboard *echo_kboard; 3097extern struct kboard *echo_kboard;
3099extern void cancel_echoing (void); 3098extern void cancel_echoing (void);
@@ -3120,7 +3119,9 @@ extern void cmd_error_internal (Lisp_Object, const char *);
3120extern Lisp_Object command_loop_1 (void); 3119extern Lisp_Object command_loop_1 (void);
3121extern Lisp_Object recursive_edit_1 (void); 3120extern Lisp_Object recursive_edit_1 (void);
3122extern void record_auto_save (void); 3121extern void record_auto_save (void);
3122#ifdef SIGDANGER
3123extern void force_auto_save_soon (void); 3123extern void force_auto_save_soon (void);
3124#endif
3124extern void init_keyboard (void); 3125extern void init_keyboard (void);
3125extern void syms_of_keyboard (void); 3126extern void syms_of_keyboard (void);
3126extern void keys_of_keyboard (void); 3127extern void keys_of_keyboard (void);
diff --git a/src/xdisp.c b/src/xdisp.c
index 14a38d82873..17a7a34b8be 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14429,7 +14429,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14429 && EQ (FRAME_SELECTED_WINDOW (f), window)) 14429 && EQ (FRAME_SELECTED_WINDOW (f), window))
14430 { 14430 {
14431 int redisplay_menu_p = 0; 14431 int redisplay_menu_p = 0;
14432 int redisplay_tool_bar_p = 0;
14433 14432
14434 if (FRAME_WINDOW_P (f)) 14433 if (FRAME_WINDOW_P (f))
14435 { 14434 {
@@ -14450,17 +14449,15 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14450 if (FRAME_WINDOW_P (f)) 14449 if (FRAME_WINDOW_P (f))
14451 { 14450 {
14452#if defined (USE_GTK) || defined (HAVE_NS) 14451#if defined (USE_GTK) || defined (HAVE_NS)
14453 redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f); 14452 if (FRAME_EXTERNAL_TOOL_BAR (f))
14453 redisplay_tool_bar (f);
14454#else 14454#else
14455 redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) 14455 if (WINDOWP (f->tool_bar_window)
14456 && (FRAME_TOOL_BAR_LINES (f) > 0 14456 && (FRAME_TOOL_BAR_LINES (f) > 0
14457 || !NILP (Vauto_resize_tool_bars)); 14457 || !NILP (Vauto_resize_tool_bars))
14458 && redisplay_tool_bar (f))
14459 ignore_mouse_drag_p = 1;
14458#endif 14460#endif
14459
14460 if (redisplay_tool_bar_p && redisplay_tool_bar (f))
14461 {
14462 ignore_mouse_drag_p = 1;
14463 }
14464 } 14461 }
14465#endif 14462#endif
14466 } 14463 }