diff options
| author | Kenichi Handa | 2008-03-05 05:12:06 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-03-05 05:12:06 +0000 |
| commit | 03365d0eb5c09d346c56437912a4ddd9b0884ac9 (patch) | |
| tree | 16f5d6f4c435dce55883371d1e1981fe175d0ad9 /src | |
| parent | e4c3c5887bc84709a269cfe67bebdfc66831af96 (diff) | |
| download | emacs-03365d0eb5c09d346c56437912a4ddd9b0884ac9.tar.gz emacs-03365d0eb5c09d346c56437912a4ddd9b0884ac9.zip | |
(char_resolve_modifier_mask): Fix previous change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/character.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/character.c b/src/character.c index f34e30912dc..457d57f9251 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -115,24 +115,18 @@ char_resolve_modifier_mask (c) | |||
| 115 | c &= ~CHAR_SHIFT; | 115 | c &= ~CHAR_SHIFT; |
| 116 | else if ((c & 0377) >= 'a' && (c & 0377) <= 'z') | 116 | else if ((c & 0377) >= 'a' && (c & 0377) <= 'z') |
| 117 | c = (c & ~CHAR_SHIFT) - ('a' - 'A'); | 117 | c = (c & ~CHAR_SHIFT) - ('a' - 'A'); |
| 118 | /* Shift modifier with ASCII control characters should be | 118 | /* Shift modifier for control characters and SPC is ignored. */ |
| 119 | ignored. */ | 119 | else if ((c & ~CHAR_MODIFIER_MASK) <= 0x20) |
| 120 | else if ((c & ~CHAR_MODIFIER_MASK) < 0x20) | ||
| 121 | c &= ~CHAR_SHIFT; | 120 | c &= ~CHAR_SHIFT; |
| 122 | } | 121 | } |
| 123 | if (c & CHAR_META) | ||
| 124 | { | ||
| 125 | /* Move the meta bit to the right place for a string. */ | ||
| 126 | c = (c & ~CHAR_META) | 0x80; | ||
| 127 | } | ||
| 128 | if (c & CHAR_CTL) | 122 | if (c & CHAR_CTL) |
| 129 | { | 123 | { |
| 130 | /* Simulate the code in lread.c. */ | 124 | /* Simulate the code in lread.c. */ |
| 131 | /* Allow `\C- ' and `\C-?'. */ | 125 | /* Allow `\C- ' and `\C-?'. */ |
| 132 | if ((c & ~CHAR_CTL) == ' ') | 126 | if ((c & 0377) == ' ') |
| 133 | c = 0; | 127 | c &= ~0177 & ~ CHAR_CTL; |
| 134 | else if ((c & ~CHAR_CTL) == '?') | 128 | else if ((c & 0377) == '?') |
| 135 | c = 127; | 129 | c = 0177 | (c & ~0177 & ~CHAR_CTL); |
| 136 | /* ASCII control chars are made from letters (both cases), | 130 | /* ASCII control chars are made from letters (both cases), |
| 137 | as well as the non-letters within 0100...0137. */ | 131 | as well as the non-letters within 0100...0137. */ |
| 138 | else if ((c & 0137) >= 0101 && (c & 0137) <= 0132) | 132 | else if ((c & 0137) >= 0101 && (c & 0137) <= 0132) |
| @@ -140,6 +134,11 @@ char_resolve_modifier_mask (c) | |||
| 140 | else if ((c & 0177) >= 0100 && (c & 0177) <= 0137) | 134 | else if ((c & 0177) >= 0100 && (c & 0177) <= 0137) |
| 141 | c &= (037 | (~0177 & ~CHAR_CTL)); | 135 | c &= (037 | (~0177 & ~CHAR_CTL)); |
| 142 | } | 136 | } |
| 137 | if (c & CHAR_META) | ||
| 138 | { | ||
| 139 | /* Move the meta bit to the right place for a string. */ | ||
| 140 | c = (c & ~CHAR_META) | 0x80; | ||
| 141 | } | ||
| 143 | 142 | ||
| 144 | return c; | 143 | return c; |
| 145 | } | 144 | } |