From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: poppyer Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <87myedbp7e.fsf@cyd.mit.edu> Reply-To: poppyer , 1721@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230659019 9874 80.91.229.12 (30 Dec 2008 17:43:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2008 17:43:39 +0000 (UTC) Cc: 1721@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 30 18:44:47 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LHie7-0000KA-2d for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2008 18:44:47 +0100 Original-Received: from localhost ([127.0.0.1]:57375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHict-0004xR-GP for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2008 12:43:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHicp-0004xM-Ki for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 12:43:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHicm-0004x9-W6 for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 12:43:26 -0500 Original-Received: from [199.232.76.173] (port=42624 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHicm-0004x6-Qz for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 12:43:24 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:58904) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LHicm-0001oa-1c for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 12:43:24 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBUHhMp8025358; Tue, 30 Dec 2008 09:43:22 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mBUHU4bh021876; Tue, 30 Dec 2008 09:30:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: poppyer Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 30 Dec 2008 17:30:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1721 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1721-submit@emacsbugs.donarmstrong.com id=B1721.123065787920488 (code B ref 1721); Tue, 30 Dec 2008 17:30:04 +0000 Original-Received: (at 1721) by emacsbugs.donarmstrong.com; 30 Dec 2008 17:24:39 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.187]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBUHOV1k020481 for <1721@emacsbugs.donarmstrong.com>; Tue, 30 Dec 2008 09:24:33 -0800 Original-Received: by ti-out-0910.google.com with SMTP id b6so3896210tic.1 for <1721@emacsbugs.donarmstrong.com>; Tue, 30 Dec 2008 09:24:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=71S/fs3/9jIAykFmgoc5bSnMaeNw2h0Ua7f1EMJL+c0=; b=co6rWXt8yBoNkUj1tfTREqdD32pO/PvXwuCsdFWGhA6DGREoiCO4nwckjEJAC0MvPi 2iTSUjak3XczfF2QzB4ZLjjIa8DsFiJtmxCRpjUpcBwR3EtZWnxJv7+VNPtSzlh1QBl3 Ks6nR5MI4AfpYs23T7e+CcQdSm73eeVS/vEgY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=MbBzpIeE7OAiqbfeZC0YLXd6LE65BkxgiDM6UWY6iF8i0I/8Cm5cwGzwlMHL5y0nE/ /vTQzVbkpF58Id9fNY2/IHI9+lX0kPtl++SltkHO+TDLeHz5u8nFvfUF2LhbS/AYj4rJ iD96MZ0qG76bqPHur4QS5+Uzwbg0g8Vz+bkCg= Original-Received: by 10.110.20.15 with SMTP id 15mr5008099tit.21.1230657871299; Tue, 30 Dec 2008 09:24:31 -0800 (PST) Original-Received: from nusnet-97-126.dynip.nus.edu.sg.yourcompany.com (nusnet-97-126.dynip.nus.edu.sg [137.132.97.126]) by mx.google.com with ESMTPS id u12sm1917128tia.9.2008.12.30.09.24.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 30 Dec 2008 09:24:29 -0800 (PST) In-Reply-To: <87myedbp7e.fsf@cyd.mit.edu> (Chong Yidong's message of "Tue, 30 Dec 2008 11:30:29 -0500") User-Agent: Emacs Gnus X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 30 Dec 2008 12:43:26 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:23593 Archived-At: Chong Yidong writes: >> Under terminal (emacs -nw), the visual-line-mode maps the arrow key >> wrongly. >> -> A M-[ >> -> B M-] >> -> D >> -> 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