From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working Date: Tue, 30 Dec 2008 21:42:04 -0500 Message-ID: References: <87myedbp7e.fsf@cyd.mit.edu> Reply-To: Stefan Monnier , 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 1230692688 3103 80.91.229.12 (31 Dec 2008 03:04:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Dec 2008 03:04:48 +0000 (UTC) Cc: Chong Yidong , 1721@emacsbugs.donarmstrong.com To: poppyer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 31 04:05:55 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 1LHrO3-0007u9-DR for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Dec 2008 04:04:47 +0100 Original-Received: from localhost ([127.0.0.1]:42687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHrMp-0006c2-N0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2008 22:03:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHrMk-0006be-6k for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:03:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHrMj-0006bK-OM for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:03:25 -0500 Original-Received: from [199.232.76.173] (port=52279 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHrMj-0006b6-DD for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:03:25 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35531) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LHrMi-0004AK-N8 for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:03:25 -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 mBV33Mw5006660; Tue, 30 Dec 2008 19:03:22 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mBV2o3vZ002994; Tue, 30 Dec 2008 18:50:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 31 Dec 2008 02:50:03 +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.12306913331609 (code B ref 1721); Wed, 31 Dec 2008 02:50:03 +0000 Original-Received: (at 1721) by emacsbugs.donarmstrong.com; 31 Dec 2008 02:42:13 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBV2gAIB001603 for <1721@emacsbugs.donarmstrong.com>; Tue, 30 Dec 2008 18:42:11 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYEAANrWklLd+aG/2dsb2JhbACBbMsOhkSBZw X-IronPort-AV: E=Sophos;i="4.36,305,1228107600"; d="scan'208";a="31628950" Original-Received: from 75-119-230-134.dsl.teksavvy.com (HELO ceviche.home) ([75.119.230.134]) by ironport2-out.teksavvy.com with ESMTP; 30 Dec 2008 21:42:04 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id A00EAB41B5; Tue, 30 Dec 2008 21:42:04 -0500 (EST) In-Reply-To: (poppyer@gmail.com's message of "Wed, 31 Dec 2008 01:24:22 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 30 Dec 2008 22:03:25 -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:23603 Archived-At: > 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)? 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? Stefan