]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
readline/
authorKazu Hirata <kazu@codesourcery.com>
Sun, 23 Jul 2006 22:22:49 +0000 (22:22 +0000)
committerKazu Hirata <kazu@codesourcery.com>
Sun, 23 Jul 2006 22:22:49 +0000 (22:22 +0000)
Backport from mainline:
* emacs_keymap.c: Add a MINGW32 hack.
* readline.c: Use _rl_bind_if_unbound to avoid macro bugs.

ChangeLog.csl
readline/emacs_keymap.c
readline/readline.c

index 2f67cc01d5e40f2ae77c4b8c9101ef09e37250ca..9813b708329ba0056b00b4be816550a61fed6542 100644 (file)
@@ -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/
index ca9d1343b655ca2eae3a04d6bc99c87e1be69854..cbacb0309af743f379a1bbd93644b66e18f9d667 100644 (file)
@@ -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 */
index 07fb58fd210d2f973c0bcbc1cf9f6e11af8d5bf9..3ba5cf00cac59805ade9e298e8181a57b6dea440 100644 (file)
@@ -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);