]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix up- and down-arrows in menus on Unix TTY (which now works).
authorEli Zaretskii <eliz@gnu.org>
Sat, 28 Sep 2013 09:03:48 +0000 (12:03 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 28 Sep 2013 09:03:48 +0000 (12:03 +0300)
lisp/menu-bar.el

index 70be2587b10e0580a84d2b55a2e47b6e64e67df0..e37c6a28b4fe94fe191769ec3ff1b1ac23fce3ef 100644 (file)
@@ -2257,9 +2257,18 @@ If nil, the current mouse position is used."
 
 (defvar tty-menu-navigation-map
   (let ((map (make-sparse-keymap)))
+    ;; The next line is disabled because it breaks interpretation of
+    ;; escape sequences, produced by TTY arrow keys, as tty-menu-*
+    ;; commands.  Instead, we explicitly bind some keys to
+    ;; tty-menu-exit.
+    ;;(define-key map [t] 'tty-menu-exit)
+
     ;; The tty-menu-* are just symbols interpreted by term.c, they are
     ;; not real commands.
-    (define-key map [t] 'tty-menu-exit)
+    (substitute-key-definition 'keyboard-quit 'tty-menu-exit
+                              map (current-global-map))
+    (substitute-key-definition 'keyboard-escape-quit 'tty-menu-exit
+                              map (current-global-map))
     (substitute-key-definition 'forward-char 'tty-menu-next-menu
                               map (current-global-map))
     (substitute-key-definition 'backward-char 'tty-menu-prev-menu