Mercurial > emacs
comparison src/keyboard.c @ 2892:7ff263825550
(follow_key): Check char in range before UPPERCASEP.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 19 May 1993 04:58:19 +0000 |
parents | 998ec1083f3d |
children | 15f219ab20d7 |
comparison
equal
deleted
inserted
replaced
2891:c10bb302a315 | 2892:7ff263825550 |
---|---|
2093 /* Turn ASCII characters into control characters | 2093 /* Turn ASCII characters into control characters |
2094 when proper. */ | 2094 when proper. */ |
2095 if (event->modifiers & ctrl_modifier) | 2095 if (event->modifiers & ctrl_modifier) |
2096 { | 2096 { |
2097 if (c >= 0100 && c < 0140) | 2097 if (c >= 0100 && c < 0140) |
2098 c &= ~040; | 2098 { |
2099 int oc = c; | |
2100 c &= ~0140; | |
2101 /* Set the shift modifier for a control char | |
2102 made from a shifted letter. But only for letters! */ | |
2103 if (oc >= 'A' && oc <= 'Z') | |
2104 c |= shift_modifier; | |
2105 } | |
2106 else if (c >= 'a' && c <= 'z') | |
2107 c &= ~0140; | |
2099 /* Include the bits for control and shift | 2108 /* Include the bits for control and shift |
2100 only if the basic ASCII code can't indicate them. */ | 2109 only if the basic ASCII code can't indicate them. */ |
2101 c |= ctrl_modifier; | 2110 else |
2111 c |= ctrl_modifier; | |
2102 } | 2112 } |
2103 /* Set the shift modifier for a control char | |
2104 made from a shifted letter. But only for letters! */ | |
2105 if (XFASTINT (event->code) >= 'A' - 0100 | |
2106 && XFASTINT (event->code) <= 'Z' - 0100 | |
2107 && (event->modifiers & shift_modifier)) | |
2108 c |= shift_modifier; | |
2109 c |= (event->modifiers | 2113 c |= (event->modifiers |
2110 & (meta_modifier | alt_modifier | 2114 & (meta_modifier | alt_modifier |
2111 | hyper_modifier | super_modifier)); | 2115 | hyper_modifier | super_modifier)); |
2112 return c; | 2116 return c; |
2113 } | 2117 } |
3387 /* When KEY is not defined in any of the keymaps, if it is an upper | 3391 /* When KEY is not defined in any of the keymaps, if it is an upper |
3388 case letter and there are bindings for the corresponding | 3392 case letter and there are bindings for the corresponding |
3389 lower-case letter, return the bindings for the lower-case letter. */ | 3393 lower-case letter, return the bindings for the lower-case letter. */ |
3390 if (first_binding == nmaps | 3394 if (first_binding == nmaps |
3391 && XTYPE (key) == Lisp_Int | 3395 && XTYPE (key) == Lisp_Int |
3392 && (UPPERCASEP (XINT (key) & 0x3ffff) | 3396 && ((((XINT (key) & 0x3ffff) |
3397 < XSTRING (current_buffer->downcase_table)->size) | |
3398 && UPPERCASEP (XINT (key) & 0x3ffff)) | |
3393 || (XINT (key) & shift_modifier))) | 3399 || (XINT (key) & shift_modifier))) |
3394 { | 3400 { |
3395 if (XINT (key) & shift_modifier) | 3401 if (XINT (key) & shift_modifier) |
3396 XSETINT (key, XINT (key) & ~shift_modifier); | 3402 XSETINT (key, XINT (key) & ~shift_modifier); |
3397 else | 3403 else |