[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow key
From: |
poppyer |
Subject: |
bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working |
Date: |
Wed, 31 Dec 2008 01:24:22 +0800 |
User-agent: |
Emacs Gnus |
Chong Yidong <cyd@stupidchicken.com> writes:
>> Under terminal (emacs -nw), the visual-line-mode maps the arrow key
>> wrongly.
>> <up> -> A M-[
>> <down> -> B M-]
>> <left> -> D
>> <right> -> C
>> and it also maps the mouse-key of xterm-mouse-mode wrongly.
>>
>> turn the visual-line-mode off will back everything to normal.
>
> This bug report is unclear, and I can not reproduce any bug with
> visual-line-mode under emacs -nw. Please provide a *precise* recipe for
> seeing this bug, starting with `emacs -Q -nw'.
I think I have got the idea. It is because visual-line-mode maps "M-["
to previous-logical-line as in simple.el
=========
(defvar visual-line-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [remap kill-line] 'kill-visual-line)
(define-key map [remap move-beginning-of-line] 'beginning-of-visual-line)
(define-key map [remap move-end-of-line] 'end-of-visual-line)
(define-key map "\M-[" 'previous-logical-line)
(define-key map "\M-]" 'next-logical-line)
map))
===========
But in terminal (-nw), arrow keys are actually "M-[ A" "M-[ B" "M-[ C"
"M-[ D". Hence letters "A" "B" "C" "D" will be inserted to the buffer.
To prove my idea, I tried:
(define-key visual-line-mode-map "\M-[" nil)
(define-key visual-line-mode-map "\M-]" nil)
and the issue is solved.
Cheers,
poppyer
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working, poppyer, 2008/12/28
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working, Chong Yidong, 2008/12/30
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working,
poppyer <=
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working, Stefan Monnier, 2008/12/30
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working, poppyer, 2008/12/30
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working, Andreas Schwab, 2008/12/31
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working, Stefan Monnier, 2008/12/31
- bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working, Andreas Schwab, 2008/12/31