aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c244
1 files changed, 82 insertions, 162 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 5b66050aa92..c177c804bad 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,6 +1,7 @@
1/* Keyboard and mouse input; editor command loop. 1/* Keyboard and mouse input; editor command loop.
2 2
3Copyright (C) 1985-1989, 1993-1997, 1999-2014 Free Software Foundation, Inc. 3Copyright (C) 1985-1989, 1993-1997, 1999-2015 Free Software Foundation,
4Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -87,11 +88,6 @@ static KBOARD *all_kboards;
87/* True in the single-kboard state, false in the any-kboard state. */ 88/* True in the single-kboard state, false in the any-kboard state. */
88static bool single_kboard; 89static bool single_kboard;
89 90
90/* Non-nil disable property on a command means
91 do not execute it; call disabled-command-function's value instead. */
92Lisp_Object Qdisabled;
93static Lisp_Object Qdisabled_command_function;
94
95#define NUM_RECENT_KEYS (300) 91#define NUM_RECENT_KEYS (300)
96 92
97/* Index for storing next element into recent_keys. */ 93/* Index for storing next element into recent_keys. */
@@ -231,42 +227,11 @@ static ptrdiff_t last_point_position;
231 'volatile' here. */ 227 'volatile' here. */
232Lisp_Object internal_last_event_frame; 228Lisp_Object internal_last_event_frame;
233 229
234static Lisp_Object Qgui_set_selection, Qhandle_switch_frame;
235static Lisp_Object Qhandle_select_window;
236Lisp_Object QPRIMARY;
237
238static Lisp_Object Qself_insert_command;
239static Lisp_Object Qforward_char;
240static Lisp_Object Qbackward_char;
241Lisp_Object Qundefined;
242static Lisp_Object Qtimer_event_handler;
243
244/* `read_key_sequence' stores here the command definition of the 230/* `read_key_sequence' stores here the command definition of the
245 key sequence that it reads. */ 231 key sequence that it reads. */
246static Lisp_Object read_key_sequence_cmd; 232static Lisp_Object read_key_sequence_cmd;
247static Lisp_Object read_key_sequence_remapped; 233static Lisp_Object read_key_sequence_remapped;
248 234
249static Lisp_Object Qinput_method_function;
250
251static Lisp_Object Qdeactivate_mark;
252
253Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook;
254
255static Lisp_Object Qecho_area_clear_hook;
256
257/* Hooks to run before and after each command. */
258static Lisp_Object Qpre_command_hook;
259static Lisp_Object Qpost_command_hook;
260
261static Lisp_Object Qdeferred_action_function;
262
263static Lisp_Object Qdelayed_warnings_hook;
264
265static Lisp_Object Qinput_method_exit_on_first_char;
266static Lisp_Object Qinput_method_use_echo_area;
267
268static Lisp_Object Qhelp_form_show;
269
270/* File in which we write all commands we read. */ 235/* File in which we write all commands we read. */
271static FILE *dribble; 236static FILE *dribble;
272 237
@@ -345,83 +310,12 @@ static struct input_event * volatile kbd_store_ptr;
345 dequeuing functions? Such a flag could be screwed up by interrupts 310 dequeuing functions? Such a flag could be screwed up by interrupts
346 at inopportune times. */ 311 at inopportune times. */
347 312
348/* Symbols to head events. */
349static Lisp_Object Qmouse_movement;
350static Lisp_Object Qscroll_bar_movement;
351Lisp_Object Qswitch_frame;
352static Lisp_Object Qfocus_in, Qfocus_out;
353static Lisp_Object Qdelete_frame;
354static Lisp_Object Qiconify_frame;
355static Lisp_Object Qmake_frame_visible;
356static Lisp_Object Qselect_window;
357Lisp_Object Qhelp_echo;
358
359static Lisp_Object Qmouse_fixup_help_message;
360
361/* Symbols to denote kinds of events. */
362static Lisp_Object Qfunction_key;
363Lisp_Object Qmouse_click;
364#ifdef HAVE_NTGUI
365Lisp_Object Qlanguage_change;
366#endif
367static Lisp_Object Qdrag_n_drop;
368static Lisp_Object Qsave_session;
369#ifdef HAVE_DBUS
370static Lisp_Object Qdbus_event;
371#endif
372#ifdef USE_FILE_NOTIFY
373static Lisp_Object Qfile_notify;
374#endif /* USE_FILE_NOTIFY */
375static Lisp_Object Qconfig_changed_event;
376
377/* Lisp_Object Qmouse_movement; - also an event header */
378
379/* Properties of event headers. */
380Lisp_Object Qevent_kind;
381static Lisp_Object Qevent_symbol_elements;
382
383/* Menu and tool bar item parts. */
384static Lisp_Object Qmenu_enable;
385static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence;
386Lisp_Object QCfilter;
387
388/* Non-nil disable property on a command means
389 do not execute it; call disabled-command-function's value instead. */
390Lisp_Object QCtoggle, QCradio;
391static Lisp_Object QCbutton, QClabel;
392
393static Lisp_Object QCvert_only;
394
395/* An event header symbol HEAD may have a property named
396 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
397 BASE is the base, unmodified version of HEAD, and MODIFIERS is the
398 mask of modifiers applied to it. If present, this is used to help
399 speed up parse_modifiers. */
400Lisp_Object Qevent_symbol_element_mask;
401
402/* An unmodified event header BASE may have a property named
403 Qmodifier_cache, which is an alist mapping modifier masks onto
404 modified versions of BASE. If present, this helps speed up
405 apply_modifiers. */
406static Lisp_Object Qmodifier_cache;
407
408/* Symbols to use for parts of windows. */
409Lisp_Object Qmode_line;
410Lisp_Object Qvertical_line;
411Lisp_Object Qright_divider, Qbottom_divider;
412Lisp_Object Qmenu_bar;
413
414static Lisp_Object Qecho_keystrokes;
415
416static void recursive_edit_unwind (Lisp_Object buffer); 313static void recursive_edit_unwind (Lisp_Object buffer);
417static Lisp_Object command_loop (void); 314static Lisp_Object command_loop (void);
418static Lisp_Object Qcommand_execute;
419 315
420static void echo_now (void); 316static void echo_now (void);
421static ptrdiff_t echo_length (void); 317static ptrdiff_t echo_length (void);
422 318
423static Lisp_Object Qpolling_period;
424
425/* Incremented whenever a timer is run. */ 319/* Incremented whenever a timer is run. */
426unsigned timers_run; 320unsigned timers_run;
427 321
@@ -1712,10 +1606,7 @@ command_loop_1 (void)
1712 } 1606 }
1713 1607
1714 if (current_buffer != prev_buffer || MODIFF != prev_modiff) 1608 if (current_buffer != prev_buffer || MODIFF != prev_modiff)
1715 { 1609 run_hook (intern ("activate-mark-hook"));
1716 Lisp_Object hook = intern ("activate-mark-hook");
1717 Frun_hooks (1, &hook);
1718 }
1719 } 1610 }
1720 1611
1721 Vsaved_region_selection = Qnil; 1612 Vsaved_region_selection = Qnil;
@@ -5277,22 +5168,17 @@ static const char *const lispy_drag_n_drop_names[] =
5277 "drag-n-drop" 5168 "drag-n-drop"
5278}; 5169};
5279 5170
5280/* Scroll bar parts. */
5281static Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
5282static Lisp_Object Qbefore_handle, Qhorizontal_handle, Qafter_handle;
5283Lisp_Object Qup, Qdown, Qtop, Qbottom;
5284static Lisp_Object Qleftmost, Qrightmost;
5285static Lisp_Object Qend_scroll;
5286static Lisp_Object Qratio;
5287
5288/* An array of scroll bar parts, indexed by an enum scroll_bar_part value. 5171/* An array of scroll bar parts, indexed by an enum scroll_bar_part value.
5289 Note that Qnil corresponds to scroll_bar_nowhere and should not appear 5172 Note that Qnil corresponds to scroll_bar_nowhere and should not appear
5290 in Lisp events. */ 5173 in Lisp events. */
5291static Lisp_Object *const scroll_bar_parts[] = { 5174static struct Lisp_Symbol *const scroll_bar_parts[] = {
5292 &Qnil, &Qabove_handle, &Qhandle, &Qbelow_handle, 5175 XSYMBOL_INIT (Qnil), XSYMBOL_INIT (Qabove_handle), XSYMBOL_INIT (Qhandle),
5293 &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio, 5176 XSYMBOL_INIT (Qbelow_handle), XSYMBOL_INIT (Qup), XSYMBOL_INIT (Qdown),
5294 &Qbefore_handle, &Qhorizontal_handle, &Qafter_handle, 5177 XSYMBOL_INIT (Qtop), XSYMBOL_INIT (Qbottom), XSYMBOL_INIT (Qend_scroll),
5295 &Qleft, &Qright, &Qleftmost, &Qrightmost, &Qend_scroll, &Qratio 5178 XSYMBOL_INIT (Qratio), XSYMBOL_INIT (Qbefore_handle),
5179 XSYMBOL_INIT (Qhorizontal_handle), XSYMBOL_INIT (Qafter_handle),
5180 XSYMBOL_INIT (Qleft), XSYMBOL_INIT (Qright), XSYMBOL_INIT (Qleftmost),
5181 XSYMBOL_INIT (Qrightmost), XSYMBOL_INIT (Qend_scroll), XSYMBOL_INIT (Qratio)
5296}; 5182};
5297 5183
5298/* A vector, indexed by button number, giving the down-going location 5184/* A vector, indexed by button number, giving the down-going location
@@ -5565,7 +5451,8 @@ static Lisp_Object
5565make_scroll_bar_position (struct input_event *ev, Lisp_Object type) 5451make_scroll_bar_position (struct input_event *ev, Lisp_Object type)
5566{ 5452{
5567 return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y), 5453 return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y),
5568 make_number (ev->timestamp), *scroll_bar_parts[ev->part]); 5454 make_number (ev->timestamp),
5455 make_lisp_symbol (scroll_bar_parts[ev->part]));
5569} 5456}
5570 5457
5571/* Given a struct input_event, build the lisp event which represents 5458/* Given a struct input_event, build the lisp event which represents
@@ -6204,7 +6091,7 @@ make_lispy_movement (struct frame *frame, Lisp_Object bar_window, enum scroll_ba
6204 { 6091 {
6205 Lisp_Object part_sym; 6092 Lisp_Object part_sym;
6206 6093
6207 part_sym = *scroll_bar_parts[(int) part]; 6094 part_sym = make_lisp_symbol (scroll_bar_parts[part]);
6208 return list2 (Qscroll_bar_movement, 6095 return list2 (Qscroll_bar_movement,
6209 list5 (bar_window, 6096 list5 (bar_window,
6210 Qvertical_scroll_bar, 6097 Qvertical_scroll_bar,
@@ -8068,11 +7955,6 @@ static Lisp_Object tool_bar_item_properties;
8068 7955
8069static int ntool_bar_items; 7956static int ntool_bar_items;
8070 7957
8071/* The symbols `:image' and `:rtl'. */
8072
8073static Lisp_Object QCimage;
8074static Lisp_Object QCrtl;
8075
8076/* Function prototypes. */ 7958/* Function prototypes. */
8077 7959
8078static void init_tool_bar_items (Lisp_Object); 7960static void init_tool_bar_items (Lisp_Object);
@@ -10331,7 +10213,6 @@ On such systems, Emacs starts a subshell instead of suspending. */)
10331 int old_height, old_width; 10213 int old_height, old_width;
10332 int width, height; 10214 int width, height;
10333 struct gcpro gcpro1; 10215 struct gcpro gcpro1;
10334 Lisp_Object hook;
10335 10216
10336 if (tty_list && tty_list->next) 10217 if (tty_list && tty_list->next)
10337 error ("There are other tty frames open; close them before suspending Emacs"); 10218 error ("There are other tty frames open; close them before suspending Emacs");
@@ -10339,9 +10220,7 @@ On such systems, Emacs starts a subshell instead of suspending. */)
10339 if (!NILP (stuffstring)) 10220 if (!NILP (stuffstring))
10340 CHECK_STRING (stuffstring); 10221 CHECK_STRING (stuffstring);
10341 10222
10342 /* Run the functions in suspend-hook. */ 10223 run_hook (intern ("suspend-hook"));
10343 hook = intern ("suspend-hook");
10344 Frun_hooks (1, &hook);
10345 10224
10346 GCPRO1 (stuffstring); 10225 GCPRO1 (stuffstring);
10347 get_tty_size (fileno (CURTTY ()->input), &old_width, &old_height); 10226 get_tty_size (fileno (CURTTY ()->input), &old_width, &old_height);
@@ -10365,9 +10244,7 @@ On such systems, Emacs starts a subshell instead of suspending. */)
10365 height - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), 10244 height - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()),
10366 0, 0, 0, 0); 10245 0, 0, 0, 0);
10367 10246
10368 /* Run suspend-resume-hook. */ 10247 run_hook (intern ("suspend-resume-hook"));
10369 hook = intern ("suspend-resume-hook");
10370 Frun_hooks (1, &hook);
10371 10248
10372 UNGCPRO; 10249 UNGCPRO;
10373 return Qnil; 10250 return Qnil;
@@ -11111,26 +10988,30 @@ init_keyboard (void)
11111#endif 10988#endif
11112} 10989}
11113 10990
11114/* This type's only use is in syms_of_keyboard, to initialize the 10991/* This type's only use is in syms_of_keyboard, to put properties on the
11115 event header symbols and put properties on them. */ 10992 event header symbols. */
11116struct event_head { 10993struct event_head {
11117 Lisp_Object *var; 10994 struct Lisp_Symbol *var;
11118 const char *name; 10995 struct Lisp_Symbol *kind;
11119 Lisp_Object *kind;
11120}; 10996};
11121 10997
10998
10999
11122static const struct event_head head_table[] = { 11000static const struct event_head head_table[] = {
11123 {&Qmouse_movement, "mouse-movement", &Qmouse_movement}, 11001 {XSYMBOL_INIT (Qmouse_movement), XSYMBOL_INIT (Qmouse_movement)},
11124 {&Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement}, 11002 {XSYMBOL_INIT (Qscroll_bar_movement), XSYMBOL_INIT (Qmouse_movement)},
11125 {&Qswitch_frame, "switch-frame", &Qswitch_frame}, 11003
11126 {&Qfocus_in, "focus-in", &Qfocus_in}, 11004 /* Some of the event heads. */
11127 {&Qfocus_out, "focus-out", &Qfocus_out}, 11005 {XSYMBOL_INIT (Qswitch_frame), XSYMBOL_INIT (Qswitch_frame)},
11128 {&Qdelete_frame, "delete-frame", &Qdelete_frame}, 11006
11129 {&Qiconify_frame, "iconify-frame", &Qiconify_frame}, 11007 {XSYMBOL_INIT (Qfocus_in), XSYMBOL_INIT (Qfocus_in)},
11130 {&Qmake_frame_visible, "make-frame-visible", &Qmake_frame_visible}, 11008 {XSYMBOL_INIT (Qfocus_out), XSYMBOL_INIT (Qfocus_out)},
11009 {XSYMBOL_INIT (Qdelete_frame), XSYMBOL_INIT (Qdelete_frame)},
11010 {XSYMBOL_INIT (Qiconify_frame), XSYMBOL_INIT (Qiconify_frame)},
11011 {XSYMBOL_INIT (Qmake_frame_visible), XSYMBOL_INIT (Qmake_frame_visible)},
11131 /* `select-window' should be handled just like `switch-frame' 11012 /* `select-window' should be handled just like `switch-frame'
11132 in read_key_sequence. */ 11013 in read_key_sequence. */
11133 {&Qselect_window, "select-window", &Qswitch_frame} 11014 {XSYMBOL_INIT (Qselect_window), XSYMBOL_INIT (Qswitch_frame)}
11134}; 11015};
11135 11016
11136void 11017void
@@ -11169,17 +11050,29 @@ syms_of_keyboard (void)
11169 DEFSYM (Qself_insert_command, "self-insert-command"); 11050 DEFSYM (Qself_insert_command, "self-insert-command");
11170 DEFSYM (Qforward_char, "forward-char"); 11051 DEFSYM (Qforward_char, "forward-char");
11171 DEFSYM (Qbackward_char, "backward-char"); 11052 DEFSYM (Qbackward_char, "backward-char");
11053
11054 /* Non-nil disable property on a command means do not execute it;
11055 call disabled-command-function's value instead. */
11172 DEFSYM (Qdisabled, "disabled"); 11056 DEFSYM (Qdisabled, "disabled");
11057
11173 DEFSYM (Qundefined, "undefined"); 11058 DEFSYM (Qundefined, "undefined");
11059
11060 /* Hooks to run before and after each command. */
11174 DEFSYM (Qpre_command_hook, "pre-command-hook"); 11061 DEFSYM (Qpre_command_hook, "pre-command-hook");
11175 DEFSYM (Qpost_command_hook, "post-command-hook"); 11062 DEFSYM (Qpost_command_hook, "post-command-hook");
11063
11176 DEFSYM (Qdeferred_action_function, "deferred-action-function"); 11064 DEFSYM (Qdeferred_action_function, "deferred-action-function");
11177 DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook"); 11065 DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook");
11178 DEFSYM (Qfunction_key, "function-key"); 11066 DEFSYM (Qfunction_key, "function-key");
11067
11068 /* The values of Qevent_kind properties. */
11179 DEFSYM (Qmouse_click, "mouse-click"); 11069 DEFSYM (Qmouse_click, "mouse-click");
11070
11180 DEFSYM (Qdrag_n_drop, "drag-n-drop"); 11071 DEFSYM (Qdrag_n_drop, "drag-n-drop");
11181 DEFSYM (Qsave_session, "save-session"); 11072 DEFSYM (Qsave_session, "save-session");
11182 DEFSYM (Qconfig_changed_event, "config-changed-event"); 11073 DEFSYM (Qconfig_changed_event, "config-changed-event");
11074
11075 /* Menu and tool bar item parts. */
11183 DEFSYM (Qmenu_enable, "menu-enable"); 11076 DEFSYM (Qmenu_enable, "menu-enable");
11184 11077
11185#ifdef HAVE_NTGUI 11078#ifdef HAVE_NTGUI
@@ -11194,6 +11087,7 @@ syms_of_keyboard (void)
11194 DEFSYM (Qfile_notify, "file-notify"); 11087 DEFSYM (Qfile_notify, "file-notify");
11195#endif /* USE_FILE_NOTIFY */ 11088#endif /* USE_FILE_NOTIFY */
11196 11089
11090 /* Menu and tool bar item parts. */
11197 DEFSYM (QCenable, ":enable"); 11091 DEFSYM (QCenable, ":enable");
11198 DEFSYM (QCvisible, ":visible"); 11092 DEFSYM (QCvisible, ":visible");
11199 DEFSYM (QChelp, ":help"); 11093 DEFSYM (QChelp, ":help");
@@ -11201,14 +11095,16 @@ syms_of_keyboard (void)
11201 DEFSYM (QCbutton, ":button"); 11095 DEFSYM (QCbutton, ":button");
11202 DEFSYM (QCkeys, ":keys"); 11096 DEFSYM (QCkeys, ":keys");
11203 DEFSYM (QCkey_sequence, ":key-sequence"); 11097 DEFSYM (QCkey_sequence, ":key-sequence");
11098
11099 /* Non-nil disable property on a command means
11100 do not execute it; call disabled-command-function's value instead. */
11204 DEFSYM (QCtoggle, ":toggle"); 11101 DEFSYM (QCtoggle, ":toggle");
11205 DEFSYM (QCradio, ":radio"); 11102 DEFSYM (QCradio, ":radio");
11206 DEFSYM (QClabel, ":label"); 11103 DEFSYM (QClabel, ":label");
11207 DEFSYM (QCvert_only, ":vert-only"); 11104 DEFSYM (QCvert_only, ":vert-only");
11208 11105
11209 DEFSYM (Qmode_line, "mode-line"); 11106 /* Symbols to use for parts of windows. */
11210 DEFSYM (Qvertical_line, "vertical-line"); 11107 DEFSYM (Qvertical_line, "vertical-line");
11211 DEFSYM (Qmenu_bar, "menu-bar");
11212 DEFSYM (Qright_divider, "right-divider"); 11108 DEFSYM (Qright_divider, "right-divider");
11213 DEFSYM (Qbottom_divider, "bottom-divider"); 11109 DEFSYM (Qbottom_divider, "bottom-divider");
11214 11110
@@ -11231,9 +11127,21 @@ syms_of_keyboard (void)
11231 DEFSYM (Qleftmost, "leftmost"); 11127 DEFSYM (Qleftmost, "leftmost");
11232 DEFSYM (Qrightmost, "rightmost"); 11128 DEFSYM (Qrightmost, "rightmost");
11233 11129
11130 /* Properties of event headers. */
11234 DEFSYM (Qevent_kind, "event-kind"); 11131 DEFSYM (Qevent_kind, "event-kind");
11235 DEFSYM (Qevent_symbol_elements, "event-symbol-elements"); 11132 DEFSYM (Qevent_symbol_elements, "event-symbol-elements");
11133
11134 /* An event header symbol HEAD may have a property named
11135 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
11136 BASE is the base, unmodified version of HEAD, and MODIFIERS is the
11137 mask of modifiers applied to it. If present, this is used to help
11138 speed up parse_modifiers. */
11236 DEFSYM (Qevent_symbol_element_mask, "event-symbol-element-mask"); 11139 DEFSYM (Qevent_symbol_element_mask, "event-symbol-element-mask");
11140
11141 /* An unmodified event header BASE may have a property named
11142 Qmodifier_cache, which is an alist mapping modifier masks onto
11143 modified versions of BASE. If present, this helps speed up
11144 apply_modifiers. */
11237 DEFSYM (Qmodifier_cache, "modifier-cache"); 11145 DEFSYM (Qmodifier_cache, "modifier-cache");
11238 11146
11239 DEFSYM (Qrecompute_lucid_menubar, "recompute-lucid-menubar"); 11147 DEFSYM (Qrecompute_lucid_menubar, "recompute-lucid-menubar");
@@ -11242,7 +11150,10 @@ syms_of_keyboard (void)
11242 DEFSYM (Qpolling_period, "polling-period"); 11150 DEFSYM (Qpolling_period, "polling-period");
11243 11151
11244 DEFSYM (Qgui_set_selection, "gui-set-selection"); 11152 DEFSYM (Qgui_set_selection, "gui-set-selection");
11153
11154 /* The primary selection. */
11245 DEFSYM (QPRIMARY, "PRIMARY"); 11155 DEFSYM (QPRIMARY, "PRIMARY");
11156
11246 DEFSYM (Qhandle_switch_frame, "handle-switch-frame"); 11157 DEFSYM (Qhandle_switch_frame, "handle-switch-frame");
11247 DEFSYM (Qhandle_select_window, "handle-select-window"); 11158 DEFSYM (Qhandle_select_window, "handle-select-window");
11248 11159
@@ -11257,17 +11168,26 @@ syms_of_keyboard (void)
11257 Fset (Qinput_method_exit_on_first_char, Qnil); 11168 Fset (Qinput_method_exit_on_first_char, Qnil);
11258 Fset (Qinput_method_use_echo_area, Qnil); 11169 Fset (Qinput_method_use_echo_area, Qnil);
11259 11170
11171 /* Symbols to head events. */
11172 DEFSYM (Qmouse_movement, "mouse-movement");
11173 DEFSYM (Qscroll_bar_movement, "scroll-bar-movement");
11174 DEFSYM (Qswitch_frame, "switch-frame");
11175 DEFSYM (Qfocus_in, "focus-in");
11176 DEFSYM (Qfocus_out, "focus-out");
11177 DEFSYM (Qdelete_frame, "delete-frame");
11178 DEFSYM (Qiconify_frame, "iconify-frame");
11179 DEFSYM (Qmake_frame_visible, "make-frame-visible");
11180 DEFSYM (Qselect_window, "select-window");
11260 { 11181 {
11261 int i; 11182 int i;
11262 int len = ARRAYELTS (head_table);
11263 11183
11264 for (i = 0; i < len; i++) 11184 for (i = 0; i < ARRAYELTS (head_table); i++)
11265 { 11185 {
11266 const struct event_head *p = &head_table[i]; 11186 const struct event_head *p = &head_table[i];
11267 *p->var = intern_c_string (p->name); 11187 Lisp_Object var = make_lisp_symbol (p->var);
11268 staticpro (p->var); 11188 Lisp_Object kind = make_lisp_symbol (p->kind);
11269 Fput (*p->var, Qevent_kind, *p->kind); 11189 Fput (var, Qevent_kind, kind);
11270 Fput (*p->var, Qevent_symbol_elements, list1 (*p->var)); 11190 Fput (var, Qevent_symbol_elements, list1 (var));
11271 } 11191 }
11272 } 11192 }
11273 11193
@@ -11593,13 +11513,13 @@ with no modifiers; thus, setting `extra-keyboard-modifiers' to zero
11593cancels any modification. */); 11513cancels any modification. */);
11594 extra_keyboard_modifiers = 0; 11514 extra_keyboard_modifiers = 0;
11595 11515
11516 DEFSYM (Qdeactivate_mark, "deactivate-mark");
11596 DEFVAR_LISP ("deactivate-mark", Vdeactivate_mark, 11517 DEFVAR_LISP ("deactivate-mark", Vdeactivate_mark,
11597 doc: /* If an editing command sets this to t, deactivate the mark afterward. 11518 doc: /* If an editing command sets this to t, deactivate the mark afterward.
11598The command loop sets this to nil before each command, 11519The command loop sets this to nil before each command,
11599and tests the value when the command returns. 11520and tests the value when the command returns.
11600Buffer modification stores t in this variable. */); 11521Buffer modification stores t in this variable. */);
11601 Vdeactivate_mark = Qnil; 11522 Vdeactivate_mark = Qnil;
11602 DEFSYM (Qdeactivate_mark, "deactivate-mark");
11603 Fmake_variable_buffer_local (Qdeactivate_mark); 11523 Fmake_variable_buffer_local (Qdeactivate_mark);
11604 11524
11605 DEFVAR_LISP ("pre-command-hook", Vpre_command_hook, 11525 DEFVAR_LISP ("pre-command-hook", Vpre_command_hook,