From 48c948de78cfa6290ca79ab34b7a4d0cb0edfb69 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 2 Sep 2012 11:50:29 +0800 Subject: [PATCH] * keymap.c (push_key_description): Print M-TAB as C-M-i. Fixes: debbugs:11758 --- src/ChangeLog | 5 +++++ src/keymap.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 095effcf3bd..cb1ef00a542 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-02 Chong Yidong + + * keymap.c (push_key_description): Print M-TAB as C-M-i + (Bug#11758). + 2012-09-02 Juanma Barranquero * makefile.w32-in (CCL_H, W32FONT_H): New macros. diff --git a/src/keymap.c b/src/keymap.c index 4031091501c..85c384b8180 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2157,7 +2157,7 @@ The `kbd' macro is an approximate inverse of this. */) char * push_key_description (EMACS_INT ch, char *p, int force_multibyte) { - int c, c2; + int c, c2, tab_as_ci; /* Clear all the meaningless bits above the meta bit. */ c = ch & (meta_modifier | ~ - meta_modifier); @@ -2171,6 +2171,8 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte) return p; } + tab_as_ci = (c2 == '\t' && (c & meta_modifier)); + if (c & alt_modifier) { *p++ = 'A'; @@ -2178,7 +2180,8 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte) c -= alt_modifier; } if ((c & ctrl_modifier) != 0 - || (c2 < ' ' && c2 != 27 && c2 != '\t' && c2 != Ctl ('M'))) + || (c2 < ' ' && c2 != 27 && c2 != '\t' && c2 != Ctl ('M')) + || tab_as_ci) { *p++ = 'C'; *p++ = '-'; @@ -2216,6 +2219,10 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte) *p++ = 'S'; *p++ = 'C'; } + else if (tab_as_ci) + { + *p++ = 'i'; + } else if (c == '\t') { *p++ = 'T'; -- 2.39.2