diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 257 |
1 files changed, 84 insertions, 173 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 9261c4b09fd..86c840d052a 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,86 +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 HAVE_XWIDGETS | ||
| 374 | Lisp_Object Qxwidget_event; | ||
| 375 | #endif | ||
| 376 | #ifdef USE_FILE_NOTIFY | ||
| 377 | static Lisp_Object Qfile_notify; | ||
| 378 | #endif /* USE_FILE_NOTIFY */ | ||
| 379 | static Lisp_Object Qconfig_changed_event; | ||
| 380 | |||
| 381 | /* Lisp_Object Qmouse_movement; - also an event header */ | ||
| 382 | |||
| 383 | /* Properties of event headers. */ | ||
| 384 | Lisp_Object Qevent_kind; | ||
| 385 | static Lisp_Object Qevent_symbol_elements; | ||
| 386 | |||
| 387 | /* Menu and tool bar item parts. */ | ||
| 388 | static Lisp_Object Qmenu_enable; | ||
| 389 | static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence; | ||
| 390 | Lisp_Object QCfilter; | ||
| 391 | |||
| 392 | /* Non-nil disable property on a command means | ||
| 393 | do not execute it; call disabled-command-function's value instead. */ | ||
| 394 | Lisp_Object QCtoggle, QCradio; | ||
| 395 | static Lisp_Object QCbutton, QClabel; | ||
| 396 | |||
| 397 | static Lisp_Object QCvert_only; | ||
| 398 | |||
| 399 | /* An event header symbol HEAD may have a property named | ||
| 400 | Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS); | ||
| 401 | BASE is the base, unmodified version of HEAD, and MODIFIERS is the | ||
| 402 | mask of modifiers applied to it. If present, this is used to help | ||
| 403 | speed up parse_modifiers. */ | ||
| 404 | Lisp_Object Qevent_symbol_element_mask; | ||
| 405 | |||
| 406 | /* An unmodified event header BASE may have a property named | ||
| 407 | Qmodifier_cache, which is an alist mapping modifier masks onto | ||
| 408 | modified versions of BASE. If present, this helps speed up | ||
| 409 | apply_modifiers. */ | ||
| 410 | static Lisp_Object Qmodifier_cache; | ||
| 411 | |||
| 412 | /* Symbols to use for parts of windows. */ | ||
| 413 | Lisp_Object Qmode_line; | ||
| 414 | Lisp_Object Qvertical_line; | ||
| 415 | Lisp_Object Qright_divider, Qbottom_divider; | ||
| 416 | Lisp_Object Qmenu_bar; | ||
| 417 | |||
| 418 | static Lisp_Object Qecho_keystrokes; | ||
| 419 | |||
| 420 | static void recursive_edit_unwind (Lisp_Object buffer); | 313 | static void recursive_edit_unwind (Lisp_Object buffer); |
| 421 | static Lisp_Object command_loop (void); | 314 | static Lisp_Object command_loop (void); |
| 422 | static Lisp_Object Qcommand_execute; | ||
| 423 | 315 | ||
| 424 | static void echo_now (void); | 316 | static void echo_now (void); |
| 425 | static ptrdiff_t echo_length (void); | 317 | static ptrdiff_t echo_length (void); |
| 426 | 318 | ||
| 427 | static Lisp_Object Qpolling_period; | ||
| 428 | |||
| 429 | /* Incremented whenever a timer is run. */ | 319 | /* Incremented whenever a timer is run. */ |
| 430 | unsigned timers_run; | 320 | unsigned timers_run; |
| 431 | 321 | ||
| @@ -1716,10 +1606,7 @@ command_loop_1 (void) | |||
| 1716 | } | 1606 | } |
| 1717 | 1607 | ||
| 1718 | if (current_buffer != prev_buffer || MODIFF != prev_modiff) | 1608 | if (current_buffer != prev_buffer || MODIFF != prev_modiff) |
| 1719 | { | 1609 | run_hook (intern ("activate-mark-hook")); |
| 1720 | Lisp_Object hook = intern ("activate-mark-hook"); | ||
| 1721 | Frun_hooks (1, &hook); | ||
| 1722 | } | ||
| 1723 | } | 1610 | } |
| 1724 | 1611 | ||
| 1725 | Vsaved_region_selection = Qnil; | 1612 | Vsaved_region_selection = Qnil; |
| @@ -4138,11 +4025,7 @@ kbd_buffer_get_event (KBOARD **kbp, | |||
| 4138 | { | 4025 | { |
| 4139 | #ifdef HAVE_W32NOTIFY | 4026 | #ifdef HAVE_W32NOTIFY |
| 4140 | /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */ | 4027 | /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */ |
| 4141 | obj = list3 (Qfile_notify, | 4028 | obj = list3 (Qfile_notify, event->arg, event->frame_or_window); |
| 4142 | list3 (make_number (event->code), | ||
| 4143 | XCAR (event->arg), | ||
| 4144 | XCDR (event->arg)), | ||
| 4145 | event->frame_or_window); | ||
| 4146 | #else | 4029 | #else |
| 4147 | obj = make_lispy_event (event); | 4030 | obj = make_lispy_event (event); |
| 4148 | #endif | 4031 | #endif |
| @@ -5295,22 +5178,17 @@ static const char *const lispy_drag_n_drop_names[] = | |||
| 5295 | "drag-n-drop" | 5178 | "drag-n-drop" |
| 5296 | }; | 5179 | }; |
| 5297 | 5180 | ||
| 5298 | /* Scroll bar parts. */ | 5181 | /* An array of symbol indexes of scroll bar parts, indexed by an enum |
| 5299 | static Lisp_Object Qabove_handle, Qhandle, Qbelow_handle; | 5182 | scroll_bar_part value. Note that Qnil corresponds to |
| 5300 | static Lisp_Object Qbefore_handle, Qhorizontal_handle, Qafter_handle; | 5183 | scroll_bar_nowhere and should not appear in Lisp events. */ |
| 5301 | Lisp_Object Qup, Qdown, Qtop, Qbottom; | 5184 | static short const scroll_bar_parts[] = { |
| 5302 | static Lisp_Object Qleftmost, Qrightmost; | 5185 | SYMBOL_INDEX (Qnil), SYMBOL_INDEX (Qabove_handle), SYMBOL_INDEX (Qhandle), |
| 5303 | static Lisp_Object Qend_scroll; | 5186 | SYMBOL_INDEX (Qbelow_handle), SYMBOL_INDEX (Qup), SYMBOL_INDEX (Qdown), |
| 5304 | static Lisp_Object Qratio; | 5187 | SYMBOL_INDEX (Qtop), SYMBOL_INDEX (Qbottom), SYMBOL_INDEX (Qend_scroll), |
| 5305 | 5188 | SYMBOL_INDEX (Qratio), SYMBOL_INDEX (Qbefore_handle), | |
| 5306 | /* An array of scroll bar parts, indexed by an enum scroll_bar_part value. | 5189 | SYMBOL_INDEX (Qhorizontal_handle), SYMBOL_INDEX (Qafter_handle), |
| 5307 | Note that Qnil corresponds to scroll_bar_nowhere and should not appear | 5190 | SYMBOL_INDEX (Qleft), SYMBOL_INDEX (Qright), SYMBOL_INDEX (Qleftmost), |
| 5308 | in Lisp events. */ | 5191 | SYMBOL_INDEX (Qrightmost), SYMBOL_INDEX (Qend_scroll), SYMBOL_INDEX (Qratio) |
| 5309 | static Lisp_Object *const scroll_bar_parts[] = { | ||
| 5310 | &Qnil, &Qabove_handle, &Qhandle, &Qbelow_handle, | ||
| 5311 | &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio, | ||
| 5312 | &Qbefore_handle, &Qhorizontal_handle, &Qafter_handle, | ||
| 5313 | &Qleft, &Qright, &Qleftmost, &Qrightmost, &Qend_scroll, &Qratio | ||
| 5314 | }; | 5192 | }; |
| 5315 | 5193 | ||
| 5316 | /* A vector, indexed by button number, giving the down-going location | 5194 | /* A vector, indexed by button number, giving the down-going location |
| @@ -5583,7 +5461,8 @@ static Lisp_Object | |||
| 5583 | make_scroll_bar_position (struct input_event *ev, Lisp_Object type) | 5461 | make_scroll_bar_position (struct input_event *ev, Lisp_Object type) |
| 5584 | { | 5462 | { |
| 5585 | return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y), | 5463 | return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y), |
| 5586 | make_number (ev->timestamp), *scroll_bar_parts[ev->part]); | 5464 | make_number (ev->timestamp), |
| 5465 | builtin_lisp_symbol (scroll_bar_parts[ev->part])); | ||
| 5587 | } | 5466 | } |
| 5588 | 5467 | ||
| 5589 | /* Given a struct input_event, build the lisp event which represents | 5468 | /* Given a struct input_event, build the lisp event which represents |
| @@ -6231,7 +6110,7 @@ make_lispy_movement (struct frame *frame, Lisp_Object bar_window, enum scroll_ba | |||
| 6231 | { | 6110 | { |
| 6232 | Lisp_Object part_sym; | 6111 | Lisp_Object part_sym; |
| 6233 | 6112 | ||
| 6234 | part_sym = *scroll_bar_parts[(int) part]; | 6113 | part_sym = builtin_lisp_symbol (scroll_bar_parts[part]); |
| 6235 | return list2 (Qscroll_bar_movement, | 6114 | return list2 (Qscroll_bar_movement, |
| 6236 | list5 (bar_window, | 6115 | list5 (bar_window, |
| 6237 | Qvertical_scroll_bar, | 6116 | Qvertical_scroll_bar, |
| @@ -8095,11 +7974,6 @@ static Lisp_Object tool_bar_item_properties; | |||
| 8095 | 7974 | ||
| 8096 | static int ntool_bar_items; | 7975 | static int ntool_bar_items; |
| 8097 | 7976 | ||
| 8098 | /* The symbols `:image' and `:rtl'. */ | ||
| 8099 | |||
| 8100 | static Lisp_Object QCimage; | ||
| 8101 | static Lisp_Object QCrtl; | ||
| 8102 | |||
| 8103 | /* Function prototypes. */ | 7977 | /* Function prototypes. */ |
| 8104 | 7978 | ||
| 8105 | static void init_tool_bar_items (Lisp_Object); | 7979 | static void init_tool_bar_items (Lisp_Object); |
| @@ -10358,7 +10232,6 @@ On such systems, Emacs starts a subshell instead of suspending. */) | |||
| 10358 | int old_height, old_width; | 10232 | int old_height, old_width; |
| 10359 | int width, height; | 10233 | int width, height; |
| 10360 | struct gcpro gcpro1; | 10234 | struct gcpro gcpro1; |
| 10361 | Lisp_Object hook; | ||
| 10362 | 10235 | ||
| 10363 | if (tty_list && tty_list->next) | 10236 | if (tty_list && tty_list->next) |
| 10364 | error ("There are other tty frames open; close them before suspending Emacs"); | 10237 | error ("There are other tty frames open; close them before suspending Emacs"); |
| @@ -10366,9 +10239,7 @@ On such systems, Emacs starts a subshell instead of suspending. */) | |||
| 10366 | if (!NILP (stuffstring)) | 10239 | if (!NILP (stuffstring)) |
| 10367 | CHECK_STRING (stuffstring); | 10240 | CHECK_STRING (stuffstring); |
| 10368 | 10241 | ||
| 10369 | /* Run the functions in suspend-hook. */ | 10242 | run_hook (intern ("suspend-hook")); |
| 10370 | hook = intern ("suspend-hook"); | ||
| 10371 | Frun_hooks (1, &hook); | ||
| 10372 | 10243 | ||
| 10373 | GCPRO1 (stuffstring); | 10244 | GCPRO1 (stuffstring); |
| 10374 | get_tty_size (fileno (CURTTY ()->input), &old_width, &old_height); | 10245 | get_tty_size (fileno (CURTTY ()->input), &old_width, &old_height); |
| @@ -10392,9 +10263,7 @@ On such systems, Emacs starts a subshell instead of suspending. */) | |||
| 10392 | height - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), | 10263 | height - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), |
| 10393 | 0, 0, 0, 0); | 10264 | 0, 0, 0, 0); |
| 10394 | 10265 | ||
| 10395 | /* Run suspend-resume-hook. */ | 10266 | run_hook (intern ("suspend-resume-hook")); |
| 10396 | hook = intern ("suspend-resume-hook"); | ||
| 10397 | Frun_hooks (1, &hook); | ||
| 10398 | 10267 | ||
| 10399 | UNGCPRO; | 10268 | UNGCPRO; |
| 10400 | return Qnil; | 10269 | return Qnil; |
| @@ -11138,26 +11007,29 @@ init_keyboard (void) | |||
| 11138 | #endif | 11007 | #endif |
| 11139 | } | 11008 | } |
| 11140 | 11009 | ||
| 11141 | /* This type's only use is in syms_of_keyboard, to initialize the | 11010 | /* This type's only use is in syms_of_keyboard, to put properties on the |
| 11142 | event header symbols and put properties on them. */ | 11011 | event header symbols. */ |
| 11143 | struct event_head { | 11012 | struct event_head |
| 11144 | Lisp_Object *var; | 11013 | { |
| 11145 | const char *name; | 11014 | short var; |
| 11146 | Lisp_Object *kind; | 11015 | short kind; |
| 11147 | }; | 11016 | }; |
| 11148 | 11017 | ||
| 11149 | static const struct event_head head_table[] = { | 11018 | static const struct event_head head_table[] = { |
| 11150 | {&Qmouse_movement, "mouse-movement", &Qmouse_movement}, | 11019 | {SYMBOL_INDEX (Qmouse_movement), SYMBOL_INDEX (Qmouse_movement)}, |
| 11151 | {&Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement}, | 11020 | {SYMBOL_INDEX (Qscroll_bar_movement), SYMBOL_INDEX (Qmouse_movement)}, |
| 11152 | {&Qswitch_frame, "switch-frame", &Qswitch_frame}, | 11021 | |
| 11153 | {&Qfocus_in, "focus-in", &Qfocus_in}, | 11022 | /* Some of the event heads. */ |
| 11154 | {&Qfocus_out, "focus-out", &Qfocus_out}, | 11023 | {SYMBOL_INDEX (Qswitch_frame), SYMBOL_INDEX (Qswitch_frame)}, |
| 11155 | {&Qdelete_frame, "delete-frame", &Qdelete_frame}, | 11024 | |
| 11156 | {&Qiconify_frame, "iconify-frame", &Qiconify_frame}, | 11025 | {SYMBOL_INDEX (Qfocus_in), SYMBOL_INDEX (Qfocus_in)}, |
| 11157 | {&Qmake_frame_visible, "make-frame-visible", &Qmake_frame_visible}, | 11026 | {SYMBOL_INDEX (Qfocus_out), SYMBOL_INDEX (Qfocus_out)}, |
| 11027 | {SYMBOL_INDEX (Qdelete_frame), SYMBOL_INDEX (Qdelete_frame)}, | ||
| 11028 | {SYMBOL_INDEX (Qiconify_frame), SYMBOL_INDEX (Qiconify_frame)}, | ||
| 11029 | {SYMBOL_INDEX (Qmake_frame_visible), SYMBOL_INDEX (Qmake_frame_visible)}, | ||
| 11158 | /* `select-window' should be handled just like `switch-frame' | 11030 | /* `select-window' should be handled just like `switch-frame' |
| 11159 | in read_key_sequence. */ | 11031 | in read_key_sequence. */ |
| 11160 | {&Qselect_window, "select-window", &Qswitch_frame} | 11032 | {SYMBOL_INDEX (Qselect_window), SYMBOL_INDEX (Qswitch_frame)} |
| 11161 | }; | 11033 | }; |
| 11162 | 11034 | ||
| 11163 | void | 11035 | void |
| @@ -11196,17 +11068,29 @@ syms_of_keyboard (void) | |||
| 11196 | DEFSYM (Qself_insert_command, "self-insert-command"); | 11068 | DEFSYM (Qself_insert_command, "self-insert-command"); |
| 11197 | DEFSYM (Qforward_char, "forward-char"); | 11069 | DEFSYM (Qforward_char, "forward-char"); |
| 11198 | DEFSYM (Qbackward_char, "backward-char"); | 11070 | DEFSYM (Qbackward_char, "backward-char"); |
| 11071 | |||
| 11072 | /* Non-nil disable property on a command means do not execute it; | ||
| 11073 | call disabled-command-function's value instead. */ | ||
| 11199 | DEFSYM (Qdisabled, "disabled"); | 11074 | DEFSYM (Qdisabled, "disabled"); |
| 11075 | |||
| 11200 | DEFSYM (Qundefined, "undefined"); | 11076 | DEFSYM (Qundefined, "undefined"); |
| 11077 | |||
| 11078 | /* Hooks to run before and after each command. */ | ||
| 11201 | DEFSYM (Qpre_command_hook, "pre-command-hook"); | 11079 | DEFSYM (Qpre_command_hook, "pre-command-hook"); |
| 11202 | DEFSYM (Qpost_command_hook, "post-command-hook"); | 11080 | DEFSYM (Qpost_command_hook, "post-command-hook"); |
| 11081 | |||
| 11203 | DEFSYM (Qdeferred_action_function, "deferred-action-function"); | 11082 | DEFSYM (Qdeferred_action_function, "deferred-action-function"); |
| 11204 | DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook"); | 11083 | DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook"); |
| 11205 | DEFSYM (Qfunction_key, "function-key"); | 11084 | DEFSYM (Qfunction_key, "function-key"); |
| 11085 | |||
| 11086 | /* The values of Qevent_kind properties. */ | ||
| 11206 | DEFSYM (Qmouse_click, "mouse-click"); | 11087 | DEFSYM (Qmouse_click, "mouse-click"); |
| 11088 | |||
| 11207 | DEFSYM (Qdrag_n_drop, "drag-n-drop"); | 11089 | DEFSYM (Qdrag_n_drop, "drag-n-drop"); |
| 11208 | DEFSYM (Qsave_session, "save-session"); | 11090 | DEFSYM (Qsave_session, "save-session"); |
| 11209 | DEFSYM (Qconfig_changed_event, "config-changed-event"); | 11091 | DEFSYM (Qconfig_changed_event, "config-changed-event"); |
| 11092 | |||
| 11093 | /* Menu and tool bar item parts. */ | ||
| 11210 | DEFSYM (Qmenu_enable, "menu-enable"); | 11094 | DEFSYM (Qmenu_enable, "menu-enable"); |
| 11211 | 11095 | ||
| 11212 | #ifdef HAVE_NTGUI | 11096 | #ifdef HAVE_NTGUI |
| @@ -11225,6 +11109,7 @@ syms_of_keyboard (void) | |||
| 11225 | DEFSYM (Qfile_notify, "file-notify"); | 11109 | DEFSYM (Qfile_notify, "file-notify"); |
| 11226 | #endif /* USE_FILE_NOTIFY */ | 11110 | #endif /* USE_FILE_NOTIFY */ |
| 11227 | 11111 | ||
| 11112 | /* Menu and tool bar item parts. */ | ||
| 11228 | DEFSYM (QCenable, ":enable"); | 11113 | DEFSYM (QCenable, ":enable"); |
| 11229 | DEFSYM (QCvisible, ":visible"); | 11114 | DEFSYM (QCvisible, ":visible"); |
| 11230 | DEFSYM (QChelp, ":help"); | 11115 | DEFSYM (QChelp, ":help"); |
| @@ -11232,14 +11117,16 @@ syms_of_keyboard (void) | |||
| 11232 | DEFSYM (QCbutton, ":button"); | 11117 | DEFSYM (QCbutton, ":button"); |
| 11233 | DEFSYM (QCkeys, ":keys"); | 11118 | DEFSYM (QCkeys, ":keys"); |
| 11234 | DEFSYM (QCkey_sequence, ":key-sequence"); | 11119 | DEFSYM (QCkey_sequence, ":key-sequence"); |
| 11120 | |||
| 11121 | /* Non-nil disable property on a command means | ||
| 11122 | do not execute it; call disabled-command-function's value instead. */ | ||
| 11235 | DEFSYM (QCtoggle, ":toggle"); | 11123 | DEFSYM (QCtoggle, ":toggle"); |
| 11236 | DEFSYM (QCradio, ":radio"); | 11124 | DEFSYM (QCradio, ":radio"); |
| 11237 | DEFSYM (QClabel, ":label"); | 11125 | DEFSYM (QClabel, ":label"); |
| 11238 | DEFSYM (QCvert_only, ":vert-only"); | 11126 | DEFSYM (QCvert_only, ":vert-only"); |
| 11239 | 11127 | ||
| 11240 | DEFSYM (Qmode_line, "mode-line"); | 11128 | /* Symbols to use for parts of windows. */ |
| 11241 | DEFSYM (Qvertical_line, "vertical-line"); | 11129 | DEFSYM (Qvertical_line, "vertical-line"); |
| 11242 | DEFSYM (Qmenu_bar, "menu-bar"); | ||
| 11243 | DEFSYM (Qright_divider, "right-divider"); | 11130 | DEFSYM (Qright_divider, "right-divider"); |
| 11244 | DEFSYM (Qbottom_divider, "bottom-divider"); | 11131 | DEFSYM (Qbottom_divider, "bottom-divider"); |
| 11245 | 11132 | ||
| @@ -11262,9 +11149,21 @@ syms_of_keyboard (void) | |||
| 11262 | DEFSYM (Qleftmost, "leftmost"); | 11149 | DEFSYM (Qleftmost, "leftmost"); |
| 11263 | DEFSYM (Qrightmost, "rightmost"); | 11150 | DEFSYM (Qrightmost, "rightmost"); |
| 11264 | 11151 | ||
| 11152 | /* Properties of event headers. */ | ||
| 11265 | DEFSYM (Qevent_kind, "event-kind"); | 11153 | DEFSYM (Qevent_kind, "event-kind"); |
| 11266 | DEFSYM (Qevent_symbol_elements, "event-symbol-elements"); | 11154 | DEFSYM (Qevent_symbol_elements, "event-symbol-elements"); |
| 11155 | |||
| 11156 | /* An event header symbol HEAD may have a property named | ||
| 11157 | Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS); | ||
| 11158 | BASE is the base, unmodified version of HEAD, and MODIFIERS is the | ||
| 11159 | mask of modifiers applied to it. If present, this is used to help | ||
| 11160 | speed up parse_modifiers. */ | ||
| 11267 | DEFSYM (Qevent_symbol_element_mask, "event-symbol-element-mask"); | 11161 | DEFSYM (Qevent_symbol_element_mask, "event-symbol-element-mask"); |
| 11162 | |||
| 11163 | /* An unmodified event header BASE may have a property named | ||
| 11164 | Qmodifier_cache, which is an alist mapping modifier masks onto | ||
| 11165 | modified versions of BASE. If present, this helps speed up | ||
| 11166 | apply_modifiers. */ | ||
| 11268 | DEFSYM (Qmodifier_cache, "modifier-cache"); | 11167 | DEFSYM (Qmodifier_cache, "modifier-cache"); |
| 11269 | 11168 | ||
| 11270 | DEFSYM (Qrecompute_lucid_menubar, "recompute-lucid-menubar"); | 11169 | DEFSYM (Qrecompute_lucid_menubar, "recompute-lucid-menubar"); |
| @@ -11273,7 +11172,10 @@ syms_of_keyboard (void) | |||
| 11273 | DEFSYM (Qpolling_period, "polling-period"); | 11172 | DEFSYM (Qpolling_period, "polling-period"); |
| 11274 | 11173 | ||
| 11275 | DEFSYM (Qgui_set_selection, "gui-set-selection"); | 11174 | DEFSYM (Qgui_set_selection, "gui-set-selection"); |
| 11175 | |||
| 11176 | /* The primary selection. */ | ||
| 11276 | DEFSYM (QPRIMARY, "PRIMARY"); | 11177 | DEFSYM (QPRIMARY, "PRIMARY"); |
| 11178 | |||
| 11277 | DEFSYM (Qhandle_switch_frame, "handle-switch-frame"); | 11179 | DEFSYM (Qhandle_switch_frame, "handle-switch-frame"); |
| 11278 | DEFSYM (Qhandle_select_window, "handle-select-window"); | 11180 | DEFSYM (Qhandle_select_window, "handle-select-window"); |
| 11279 | 11181 | ||
| @@ -11288,17 +11190,26 @@ syms_of_keyboard (void) | |||
| 11288 | Fset (Qinput_method_exit_on_first_char, Qnil); | 11190 | Fset (Qinput_method_exit_on_first_char, Qnil); |
| 11289 | Fset (Qinput_method_use_echo_area, Qnil); | 11191 | Fset (Qinput_method_use_echo_area, Qnil); |
| 11290 | 11192 | ||
| 11193 | /* Symbols to head events. */ | ||
| 11194 | DEFSYM (Qmouse_movement, "mouse-movement"); | ||
| 11195 | DEFSYM (Qscroll_bar_movement, "scroll-bar-movement"); | ||
| 11196 | DEFSYM (Qswitch_frame, "switch-frame"); | ||
| 11197 | DEFSYM (Qfocus_in, "focus-in"); | ||
| 11198 | DEFSYM (Qfocus_out, "focus-out"); | ||
| 11199 | DEFSYM (Qdelete_frame, "delete-frame"); | ||
| 11200 | DEFSYM (Qiconify_frame, "iconify-frame"); | ||
| 11201 | DEFSYM (Qmake_frame_visible, "make-frame-visible"); | ||
| 11202 | DEFSYM (Qselect_window, "select-window"); | ||
| 11291 | { | 11203 | { |
| 11292 | int i; | 11204 | int i; |
| 11293 | int len = ARRAYELTS (head_table); | ||
| 11294 | 11205 | ||
| 11295 | for (i = 0; i < len; i++) | 11206 | for (i = 0; i < ARRAYELTS (head_table); i++) |
| 11296 | { | 11207 | { |
| 11297 | const struct event_head *p = &head_table[i]; | 11208 | const struct event_head *p = &head_table[i]; |
| 11298 | *p->var = intern_c_string (p->name); | 11209 | Lisp_Object var = builtin_lisp_symbol (p->var); |
| 11299 | staticpro (p->var); | 11210 | Lisp_Object kind = builtin_lisp_symbol (p->kind); |
| 11300 | Fput (*p->var, Qevent_kind, *p->kind); | 11211 | Fput (var, Qevent_kind, kind); |
| 11301 | Fput (*p->var, Qevent_symbol_elements, list1 (*p->var)); | 11212 | Fput (var, Qevent_symbol_elements, list1 (var)); |
| 11302 | } | 11213 | } |
| 11303 | } | 11214 | } |
| 11304 | 11215 | ||
| @@ -11624,13 +11535,13 @@ with no modifiers; thus, setting `extra-keyboard-modifiers' to zero | |||
| 11624 | cancels any modification. */); | 11535 | cancels any modification. */); |
| 11625 | extra_keyboard_modifiers = 0; | 11536 | extra_keyboard_modifiers = 0; |
| 11626 | 11537 | ||
| 11538 | DEFSYM (Qdeactivate_mark, "deactivate-mark"); | ||
| 11627 | DEFVAR_LISP ("deactivate-mark", Vdeactivate_mark, | 11539 | DEFVAR_LISP ("deactivate-mark", Vdeactivate_mark, |
| 11628 | doc: /* If an editing command sets this to t, deactivate the mark afterward. | 11540 | doc: /* If an editing command sets this to t, deactivate the mark afterward. |
| 11629 | The command loop sets this to nil before each command, | 11541 | The command loop sets this to nil before each command, |
| 11630 | and tests the value when the command returns. | 11542 | and tests the value when the command returns. |
| 11631 | Buffer modification stores t in this variable. */); | 11543 | Buffer modification stores t in this variable. */); |
| 11632 | Vdeactivate_mark = Qnil; | 11544 | Vdeactivate_mark = Qnil; |
| 11633 | DEFSYM (Qdeactivate_mark, "deactivate-mark"); | ||
| 11634 | Fmake_variable_buffer_local (Qdeactivate_mark); | 11545 | Fmake_variable_buffer_local (Qdeactivate_mark); |
| 11635 | 11546 | ||
| 11636 | DEFVAR_LISP ("pre-command-hook", Vpre_command_hook, | 11547 | DEFVAR_LISP ("pre-command-hook", Vpre_command_hook, |