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 11:09:33 +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 1230694597 7038 80.91.229.12 (31 Dec 2008 03:36:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Dec 2008 03:36:37 +0000 (UTC) Cc: Chong Yidong , 1721@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 31 04:37:44 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 1LHrtv-00081T-Qs for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Dec 2008 04:37:44 +0100 Original-Received: from localhost ([127.0.0.1]:54027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHrsi-0002Jw-4e for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Dec 2008 22:36:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHrg6-00051m-Ew for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:23:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHrg5-000516-3w for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:23:25 -0500 Original-Received: from [199.232.76.173] (port=35222 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHrg4-000512-Uw for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:23:25 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:54862) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LHrg4-0005ud-FN for bug-gnu-emacs@gnu.org; Tue, 30 Dec 2008 22:23: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 mBV3NM78012307; Tue, 30 Dec 2008 19:23:22 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mBV3F3as009951; Tue, 30 Dec 2008 19:15:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: poppyer Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 31 Dec 2008 03:15: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.12306929918679 (code B ref 1721); Wed, 31 Dec 2008 03:15:03 +0000 Original-Received: (at 1721) by emacsbugs.donarmstrong.com; 31 Dec 2008 03:09:51 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBV39ikq008673 for <1721@emacsbugs.donarmstrong.com>; Tue, 30 Dec 2008 19:09:45 -0800 Original-Received: by wa-out-1112.google.com with SMTP id j40so3426243wah.1 for <1721@emacsbugs.donarmstrong.com>; Tue, 30 Dec 2008 19:09:43 -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=XGAycCMaRb/iBor+oTzG8YdYu3AcN9qMaGLj+B9vVyk=; b=bMq6NzNmoSqfHZhOygTxm9QINh5ersA3faixA8qMWg1hoWxpve8/tMMjCuTFPX0t7Q K24cEKfdHvp86CfqgZ1IfS3zfyMocaRxYcNAvf9jyJVKQjBk9bHPDt2PhcxwvEFOzMQl 9tGUIPkd4ILME2iksLIYjnA+yIbxv9/bqalN8= 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=h/AMJm9owY637pXnOWu9a+JrUQ5NBf1Xv/va4JTSlHBW4mjuQhkEUzP34RAPM4IVQ+ oQrQhoNEgNTOhZ/jhq/w/C75r3KKvDAy6ffS3u/BQMli1tEijH/YoGcDvokERL46Y6wG sUGr3ONW5+aaEuaw9SuLqUX2kbVm7bIstFyGk= Original-Received: by 10.114.181.1 with SMTP id d1mr10179607waf.227.1230692983820; Tue, 30 Dec 2008 19:09:43 -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 m26sm17947071pof.18.2008.12.30.19.09.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 30 Dec 2008 19:09:42 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Tue, 30 Dec 2008 21:42:04 -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 22:23: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:23605 Archived-At: Stefan Monnier 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