summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2006-07-23 22:22:49 +0000
committerKazu Hirata <kazu@codesourcery.com>2006-07-23 22:22:49 +0000
commitb99c4c6b70b2f811ec4ab25f4d32fe840467159a (patch)
tree2a1bfa2200878aeb4f23bde8bb7d68e9a73774be
parent0ed1cc44f49e922675518790ac62bb9e7fa36219 (diff)
downloadgdb-b99c4c6b70b2f811ec4ab25f4d32fe840467159a.tar.gz
readline/
Backport from mainline: * emacs_keymap.c: Add a MINGW32 hack. * readline.c: Use _rl_bind_if_unbound to avoid macro bugs.
-rw-r--r--ChangeLog.csl7
-rw-r--r--readline/emacs_keymap.c4
-rw-r--r--readline/readline.c17
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 <kazu@codesourcery.com>
+
+ 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 <nathan@codesourcery.com>
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);