summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-08-14 12:44:38 +0000
committerGerd Moellmann <gerd@gnu.org>2000-08-14 12:44:38 +0000
commitbc89c6093d668fa2bb054d5e95a5ffcf3b4c37f0 (patch)
tree758af76a3d966f7012988f3746a3ca3adadf89dd
parent6eb6c4c1967757c5b915424d392676ee75665a92 (diff)
downloademacs-bc89c6093d668fa2bb054d5e95a5ffcf3b4c37f0.tar.gz
emacs-bc89c6093d668fa2bb054d5e95a5ffcf3b4c37f0.tar.bz2
emacs-bc89c6093d668fa2bb054d5e95a5ffcf3b4c37f0.zip
(push_key_description): If C without modifiers is < 32,
make sure to print `C-' before `M-', like in the manual.
-rw-r--r--src/keymap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/keymap.c b/src/keymap.c
index d577fb7acbc..3d6cf0c4723 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1824,8 +1824,12 @@ push_key_description (c, p)
register unsigned int c;
register char *p;
{
+ unsigned c2;
+
/* Clear all the meaningless bits above the meta bit. */
c &= meta_modifier | ~ - meta_modifier;
+ c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
+ | meta_modifier | shift_modifier | super_modifier);
if (c & alt_modifier)
{
@@ -1833,11 +1837,12 @@ push_key_description (c, p)
*p++ = '-';
c -= alt_modifier;
}
- if (c & ctrl_modifier)
+ if ((c & ctrl_modifier) != 0
+ || (c2 < ' ' && c2 != 27 && c2 != '\t' && c2 != Ctl ('M')))
{
*p++ = 'C';
*p++ = '-';
- c -= ctrl_modifier;
+ c &= ~ctrl_modifier;
}
if (c & hyper_modifier)
{
@@ -1885,8 +1890,7 @@ push_key_description (c, p)
}
else
{
- *p++ = 'C';
- *p++ = '-';
+ /* `C-' already added above. */
if (c > 0 && c <= Ctl ('Z'))
*p++ = c + 0140;
else