From: poppyer <poppyer@gmail.com>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 1721@emacsbugs.donarmstrong.com
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 [thread overview]
Message-ID: <j8fxk5efuh.fsf@nusnet-97-126.dynip.nus.edu.sg> (raw)
In-Reply-To: <87myedbp7e.fsf@cyd.mit.edu> (Chong Yidong's message of "Tue, 30 Dec 2008 11:30:29 -0500")
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
next prev parent reply other threads:[~2008-12-30 17:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 16:30 bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working Chong Yidong
2008-12-30 17:24 ` poppyer [this message]
2008-12-31 2:42 ` Stefan Monnier
2008-12-31 3:09 ` poppyer
2008-12-31 9:09 ` Andreas Schwab
2008-12-31 18:30 ` Stefan Monnier
2008-12-31 19:26 ` Andreas Schwab
2009-01-02 4:02 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2008-12-28 14:25 poppyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=j8fxk5efuh.fsf@nusnet-97-126.dynip.nus.edu.sg \
--to=poppyer@gmail.com \
--cc=1721@emacsbugs.donarmstrong.com \
--cc=cyd@stupidchicken.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).