From b99c4c6b70b2f811ec4ab25f4d32fe840467159a Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 23 Jul 2006 22:22:49 +0000 Subject: readline/ Backport from mainline: * emacs_keymap.c: Add a MINGW32 hack. * readline.c: Use _rl_bind_if_unbound to avoid macro bugs. --- ChangeLog.csl | 7 +++++++ readline/emacs_keymap.c | 4 ++++ readline/readline.c | 17 ++++------------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ChangeLog.csl b/ChangeLog.csl index 2f67cc01d5e..9813b708329 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,10 @@ +2006-07-23 Kazu Hirata + + readline/ + Backport from mainline: + * emacs_keymap.c: Add a MINGW32 hack. + * readline.c: Use _rl_bind_if_unbound to avoid macro bugs. + 2006-07-18 Nathan Sidwell gdb/ diff --git a/readline/emacs_keymap.c b/readline/emacs_keymap.c index ca9d1343b65..cbacb0309af 100644 --- a/readline/emacs_keymap.c +++ b/readline/emacs_keymap.c @@ -278,7 +278,11 @@ KEYMAP_ENTRY_ARRAY emacs_standard_keymap = { { ISFUNC, rl_insert }, /* Latin capital letter Y with acute */ { ISFUNC, rl_insert }, /* Latin capital letter thorn (Icelandic) */ { ISFUNC, rl_insert }, /* Latin small letter sharp s (German) */ +#ifndef __MINGW32__ { ISFUNC, rl_insert }, /* Latin small letter a with grave */ +#else + { ISFUNC, 0 }, /* Must leave this unbound for the arrow keys to work. */ +#endif { ISFUNC, rl_insert }, /* Latin small letter a with acute */ { ISFUNC, rl_insert }, /* Latin small letter a with circumflex */ { ISFUNC, rl_insert }, /* Latin small letter a with tilde */ diff --git a/readline/readline.c b/readline/readline.c index 07fb58fd210..3ba5cf00cac 100644 --- a/readline/readline.c +++ b/readline/readline.c @@ -869,19 +869,10 @@ bind_arrow_keys_internal (map) #endif #ifdef __MINGW32__ - /* Under Windows, when an extend key (like an arrow key) is - pressed, getch() will return 340 (octal) followed by a code for - the extended key. We use macros to transform those into the - normal ANSI terminal sequences for these keys. */ - - /* Up arrow. */ - rl_macro_bind ("\340H", "\033[A", map); - /* Left arrow. */ - rl_macro_bind ("\340K", "\033[D", map); - /* Right arrow. */ - rl_macro_bind ("\340M", "\033[C", map); - /* Down arrow. */ - rl_macro_bind ("\340P", "\033[B", map); + _rl_bind_if_unbound ("\340H", rl_get_previous_history); + _rl_bind_if_unbound ("\340P", rl_get_next_history); + _rl_bind_if_unbound ("\340M", rl_forward_char); + _rl_bind_if_unbound ("\340K", rl_backward_char); #endif _rl_bind_if_unbound ("\033[A", rl_get_previous_history); -- cgit v1.2.1