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