diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 69 |
1 files changed, 8 insertions, 61 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 16df84b80f5..e4aac125a61 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2570,8 +2570,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2570 | and loop around to read another event. */ | 2570 | and loop around to read another event. */ |
| 2571 | save = Vquit_flag; | 2571 | save = Vquit_flag; |
| 2572 | Vquit_flag = Qnil; | 2572 | Vquit_flag = Qnil; |
| 2573 | tem = get_keyelt (access_keymap (get_keymap_1 (Vspecial_event_map, 0, 0), | 2573 | tem = access_keymap (get_keymap_1 (Vspecial_event_map, 0, 0), c, 0, 0, 1); |
| 2574 | c, 0, 0), 1); | ||
| 2575 | Vquit_flag = save; | 2574 | Vquit_flag = save; |
| 2576 | 2575 | ||
| 2577 | if (!NILP (tem)) | 2576 | if (!NILP (tem)) |
| @@ -6254,7 +6253,7 @@ menu_bar_items (old) | |||
| 6254 | for (mapno = nmaps - 1; mapno >= 0; mapno--) | 6253 | for (mapno = nmaps - 1; mapno >= 0; mapno--) |
| 6255 | if (!NILP (maps[mapno])) | 6254 | if (!NILP (maps[mapno])) |
| 6256 | { | 6255 | { |
| 6257 | def = get_keyelt (access_keymap (maps[mapno], Qmenu_bar, 1, 0), 0); | 6256 | def = access_keymap (maps[mapno], Qmenu_bar, 1, 0, 0); |
| 6258 | tem = Fkeymapp (def); | 6257 | tem = Fkeymapp (def); |
| 6259 | if (!NILP (tem)) | 6258 | if (!NILP (tem)) |
| 6260 | menu_bar_one_keymap (def); | 6259 | menu_bar_one_keymap (def); |
| @@ -6911,8 +6910,9 @@ tool_bar_items (reuse, nitems) | |||
| 6911 | if (!NILP (maps[i])) | 6910 | if (!NILP (maps[i])) |
| 6912 | { | 6911 | { |
| 6913 | Lisp_Object keymap; | 6912 | Lisp_Object keymap; |
| 6914 | 6913 | ||
| 6915 | keymap = get_keyelt (access_keymap (maps[i], Qtool_bar, 1, 1), 0); | 6914 | /* Why set the `noinherit' flag ? -sm */ |
| 6915 | keymap = access_keymap (maps[i], Qtool_bar, 1, 1, 0); | ||
| 6916 | if (!NILP (Fkeymapp (keymap))) | 6916 | if (!NILP (Fkeymapp (keymap))) |
| 6917 | { | 6917 | { |
| 6918 | Lisp_Object tail; | 6918 | Lisp_Object tail; |
| @@ -7599,31 +7599,6 @@ follow_key (key, nmaps, current, defs, next) | |||
| 7599 | int i, first_binding; | 7599 | int i, first_binding; |
| 7600 | int did_meta = 0; | 7600 | int did_meta = 0; |
| 7601 | 7601 | ||
| 7602 | /* If KEY is a meta ASCII character, treat it like meta-prefix-char | ||
| 7603 | followed by the corresponding non-meta character. | ||
| 7604 | Put the results into DEFS, since we are going to alter that anyway. | ||
| 7605 | Do not alter CURRENT or NEXT. */ | ||
| 7606 | if (INTEGERP (key) && (XUINT (key) & CHAR_META)) | ||
| 7607 | { | ||
| 7608 | for (i = 0; i < nmaps; i++) | ||
| 7609 | if (! NILP (current[i])) | ||
| 7610 | { | ||
| 7611 | Lisp_Object def; | ||
| 7612 | def = get_keyelt (access_keymap (current[i], | ||
| 7613 | meta_prefix_char, 1, 0), 0); | ||
| 7614 | |||
| 7615 | /* Note that since we pass the resulting bindings through | ||
| 7616 | get_keymap_1, non-prefix bindings for meta-prefix-char | ||
| 7617 | disappear. */ | ||
| 7618 | defs[i] = get_keymap_1 (def, 0, 1); | ||
| 7619 | } | ||
| 7620 | else | ||
| 7621 | defs[i] = Qnil; | ||
| 7622 | |||
| 7623 | did_meta = 1; | ||
| 7624 | XSETINT (key, XFASTINT (key) & ~CHAR_META); | ||
| 7625 | } | ||
| 7626 | |||
| 7627 | first_binding = nmaps; | 7602 | first_binding = nmaps; |
| 7628 | for (i = nmaps - 1; i >= 0; i--) | 7603 | for (i = nmaps - 1; i >= 0; i--) |
| 7629 | { | 7604 | { |
| @@ -7635,7 +7610,7 @@ follow_key (key, nmaps, current, defs, next) | |||
| 7635 | else | 7610 | else |
| 7636 | map = current[i]; | 7611 | map = current[i]; |
| 7637 | 7612 | ||
| 7638 | defs[i] = get_keyelt (access_keymap (map, key, 1, 0), 1); | 7613 | defs[i] = access_keymap (map, key, 1, 0, 1); |
| 7639 | if (! NILP (defs[i])) | 7614 | if (! NILP (defs[i])) |
| 7640 | first_binding = i; | 7615 | first_binding = i; |
| 7641 | } | 7616 | } |
| @@ -8457,22 +8432,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 8457 | Lisp_Object key; | 8432 | Lisp_Object key; |
| 8458 | 8433 | ||
| 8459 | key = keybuf[fkey_end++]; | 8434 | key = keybuf[fkey_end++]; |
| 8460 | /* Look up meta-characters by prefixing them | ||
| 8461 | with meta_prefix_char. I hate this. */ | ||
| 8462 | if (INTEGERP (key) && XUINT (key) & meta_modifier) | ||
| 8463 | { | ||
| 8464 | fkey_next | ||
| 8465 | = get_keymap_1 | ||
| 8466 | (get_keyelt | ||
| 8467 | (access_keymap (fkey_map, meta_prefix_char, 1, 0), 0), | ||
| 8468 | 0, 1); | ||
| 8469 | XSETFASTINT (key, XFASTINT (key) & ~meta_modifier); | ||
| 8470 | } | ||
| 8471 | else | ||
| 8472 | fkey_next = fkey_map; | ||
| 8473 | |||
| 8474 | fkey_next | 8435 | fkey_next |
| 8475 | = get_keyelt (access_keymap (fkey_next, key, 1, 0), 1); | 8436 | = access_keymap (fkey_map, key, 1, 0, 1); |
| 8476 | 8437 | ||
| 8477 | /* Handle symbol with autoload definition. */ | 8438 | /* Handle symbol with autoload definition. */ |
| 8478 | if (SYMBOLP (fkey_next) && ! NILP (Ffboundp (fkey_next)) | 8439 | if (SYMBOLP (fkey_next) && ! NILP (Ffboundp (fkey_next)) |
| @@ -8581,22 +8542,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 8581 | Lisp_Object key; | 8542 | Lisp_Object key; |
| 8582 | 8543 | ||
| 8583 | key = keybuf[keytran_end++]; | 8544 | key = keybuf[keytran_end++]; |
| 8584 | /* Look up meta-characters by prefixing them | ||
| 8585 | with meta_prefix_char. I hate this. */ | ||
| 8586 | if (INTEGERP (key) && XUINT (key) & meta_modifier) | ||
| 8587 | { | ||
| 8588 | keytran_next | ||
| 8589 | = get_keymap_1 | ||
| 8590 | (get_keyelt | ||
| 8591 | (access_keymap (keytran_map, meta_prefix_char, 1, 0), 0), | ||
| 8592 | 0, 1); | ||
| 8593 | XSETFASTINT (key, XFASTINT (key) & ~meta_modifier); | ||
| 8594 | } | ||
| 8595 | else | ||
| 8596 | keytran_next = keytran_map; | ||
| 8597 | |||
| 8598 | keytran_next | 8545 | keytran_next |
| 8599 | = get_keyelt (access_keymap (keytran_next, key, 1, 0), 1); | 8546 | = access_keymap (keytran_map, key, 1, 0, 1); |
| 8600 | 8547 | ||
| 8601 | /* Handle symbol with autoload definition. */ | 8548 | /* Handle symbol with autoload definition. */ |
| 8602 | if (SYMBOLP (keytran_next) && ! NILP (Ffboundp (keytran_next)) | 8549 | if (SYMBOLP (keytran_next) && ! NILP (Ffboundp (keytran_next)) |