unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: poppyer <poppyer@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Chong Yidong <cyd@stupidchicken.com>, 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 11:09:33 +0800	[thread overview]
Message-ID: <i2abaddor6.fsf@nusnet-97-126.dynip.nus.edu.sg> (raw)
In-Reply-To: <jwvwsdhrs0j.fsf-monnier+emacsbugreports@gnu.org> (Stefan Monnier's message of "Tue, 30 Dec 2008 21:42:04 -0500")


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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.
>
> That looks like a problem indeed.  This said, since Emacs-23 uses
> input-decode-map rather than function-key-map to decode M-[ A into an
> arrow key, it should take precedence to the binding in
> visual-line-mode-map.  Can you check input-decode-map and
> function-key-map to make sure that the mapping from escape sequence to
> arrow key events is at the right place (i.e. not in function-key-map)?
Yes, they are in input-decode-map and not in function-key-map

>
> Also, the terminals to which I have access use difference sequences than
> the ones you show (which do ring a bell, tho).  Could you give us some
> details about the terminal you're using and its configuration?
I am using iTerm.app (http://iterm.sourceforge.net/) under MAC


Thanks,
poppyer






  reply	other threads:[~2008-12-31  3:09 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
2008-12-31  2:42   ` Stefan Monnier
2008-12-31  3:09     ` poppyer [this message]
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=i2abaddor6.fsf@nusnet-97-126.dynip.nus.edu.sg \
    --to=poppyer@gmail.com \
    --cc=1721@emacsbugs.donarmstrong.com \
    --cc=cyd@stupidchicken.com \
    --cc=monnier@iro.umontreal.ca \
    /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).