diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index ed8e71fd0a7..0fad633581d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -9642,22 +9642,26 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9642 | use the corresponding lower-case letter instead. */ | 9642 | use the corresponding lower-case letter instead. */ |
| 9643 | if (NILP (current_binding) | 9643 | if (NILP (current_binding) |
| 9644 | && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t | 9644 | && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t |
| 9645 | && INTEGERP (key) | 9645 | && INTEGERP (key)) |
| 9646 | && ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK)) | ||
| 9647 | && uppercasep (XINT (key) & ~CHAR_MODIFIER_MASK)) | ||
| 9648 | || (XINT (key) & shift_modifier))) | ||
| 9649 | { | 9646 | { |
| 9650 | Lisp_Object new_key; | 9647 | Lisp_Object new_key; |
| 9648 | int k = XINT (key); | ||
| 9649 | |||
| 9650 | if (k & shift_modifier) | ||
| 9651 | XSETINT (new_key, k & ~shift_modifier); | ||
| 9652 | else if (CHARACTERP (make_number (k & ~CHAR_MODIFIER_MASK))) | ||
| 9653 | { | ||
| 9654 | int dc = downcase(k & ~CHAR_MODIFIER_MASK); | ||
| 9655 | if (dc == (k & ~CHAR_MODIFIER_MASK)) | ||
| 9656 | goto not_upcase; | ||
| 9657 | XSETINT (new_key, dc | (k & CHAR_MODIFIER_MASK)); | ||
| 9658 | } | ||
| 9659 | else | ||
| 9660 | goto not_upcase; | ||
| 9651 | 9661 | ||
| 9652 | original_uppercase = key; | 9662 | original_uppercase = key; |
| 9653 | original_uppercase_position = t - 1; | 9663 | original_uppercase_position = t - 1; |
| 9654 | 9664 | ||
| 9655 | if (XINT (key) & shift_modifier) | ||
| 9656 | XSETINT (new_key, XINT (key) & ~shift_modifier); | ||
| 9657 | else | ||
| 9658 | XSETINT (new_key, (downcase (XINT (key) & ~CHAR_MODIFIER_MASK) | ||
| 9659 | | (XINT (key) & CHAR_MODIFIER_MASK))); | ||
| 9660 | |||
| 9661 | /* We have to do this unconditionally, regardless of whether | 9665 | /* We have to do this unconditionally, regardless of whether |
| 9662 | the lower-case char is defined in the keymaps, because they | 9666 | the lower-case char is defined in the keymaps, because they |
| 9663 | might get translated through function-key-map. */ | 9667 | might get translated through function-key-map. */ |
| @@ -9668,6 +9672,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9668 | goto replay_sequence; | 9672 | goto replay_sequence; |
| 9669 | } | 9673 | } |
| 9670 | 9674 | ||
| 9675 | not_upcase: | ||
| 9671 | if (NILP (current_binding) | 9676 | if (NILP (current_binding) |
| 9672 | && help_char_p (EVENT_HEAD (key)) && t > 1) | 9677 | && help_char_p (EVENT_HEAD (key)) && t > 1) |
| 9673 | { | 9678 | { |