diff options
| author | Don March | 2011-08-02 17:27:38 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2011-08-02 17:27:38 +0200 |
| commit | b099e0639249800f68792c11ef0415916d75f598 (patch) | |
| tree | a31c8ef0d09c211afa2d40fafb8e87e9daeeed94 /src | |
| parent | b96dec833c2cca0e7a99e3cc7b3c1660fed64b92 (diff) | |
| download | emacs-b099e0639249800f68792c11ef0415916d75f598.tar.gz emacs-b099e0639249800f68792c11ef0415916d75f598.zip | |
Fix non-prefix key error message when last character M-[char] is translated to ESC [char]
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/keymap.c | 28 |
2 files changed, 26 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 80508531b1a..858833dbe25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-12-03 Don March <don@ohspite.net> | ||
| 2 | |||
| 3 | * keymap.c (Fdefine_key): Fix non-prefix key error message when | ||
| 4 | last character M-[char] is translated to ESC [char] (bug#7541). | ||
| 5 | |||
| 1 | 2011-08-02 Kenichi Handa <handa@m17n.org> | 6 | 2011-08-02 Kenichi Handa <handa@m17n.org> |
| 2 | 7 | ||
| 3 | * lisp.h (uniprop_table): Extern it. | 8 | * lisp.h (uniprop_table): Extern it. |
diff --git a/src/keymap.c b/src/keymap.c index 0169276bef9..03688abfe4c 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1216,13 +1216,27 @@ binding KEY to DEF is added at the front of KEYMAP. */) | |||
| 1216 | 1216 | ||
| 1217 | keymap = get_keymap (cmd, 0, 1); | 1217 | keymap = get_keymap (cmd, 0, 1); |
| 1218 | if (!CONSP (keymap)) | 1218 | if (!CONSP (keymap)) |
| 1219 | /* We must use Fkey_description rather than just passing key to | 1219 | { |
| 1220 | error; key might be a vector, not a string. */ | 1220 | char trailing_esc[5]; |
| 1221 | error ("Key sequence %s starts with non-prefix key %s", | 1221 | if (c == meta_prefix_char && metized) |
| 1222 | SDATA (Fkey_description (key, Qnil)), | 1222 | { |
| 1223 | SDATA (Fkey_description (Fsubstring (key, make_number (0), | 1223 | if (idx == 0) |
| 1224 | make_number (idx)), | 1224 | strcpy(trailing_esc, "ESC"); |
| 1225 | Qnil))); | 1225 | else |
| 1226 | strcpy(trailing_esc, " ESC"); | ||
| 1227 | } | ||
| 1228 | else | ||
| 1229 | strcpy(trailing_esc, ""); | ||
| 1230 | |||
| 1231 | /* We must use Fkey_description rather than just passing key to | ||
| 1232 | error; key might be a vector, not a string. */ | ||
| 1233 | error ("Key sequence %s starts with non-prefix key %s%s", | ||
| 1234 | SDATA (Fkey_description (key, Qnil)), | ||
| 1235 | SDATA (Fkey_description (Fsubstring (key, make_number (0), | ||
| 1236 | make_number (idx)), | ||
| 1237 | Qnil)), | ||
| 1238 | trailing_esc); | ||
| 1239 | } | ||
| 1226 | } | 1240 | } |
| 1227 | } | 1241 | } |
| 1228 | 1242 | ||