From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karoly Lorentey Newsgroups: gmane.emacs.devel Subject: Re: [multi-tty] Odd regression in vcursor mode in terminal Date: Sun, 20 May 2007 19:31:51 +0200 Message-ID: <46508607.1080402@lorentey.hu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1179682521 3888 80.91.229.12 (20 May 2007 17:35:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 20 May 2007 17:35:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 20 19:35:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HppJO-0002W1-IO for ged-emacs-devel@m.gmane.org; Sun, 20 May 2007 19:35:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HppJO-00042p-4c for ged-emacs-devel@m.gmane.org; Sun, 20 May 2007 13:35:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HppJK-00042G-C1 for emacs-devel@gnu.org; Sun, 20 May 2007 13:35:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HppJJ-00041l-DT for emacs-devel@gnu.org; Sun, 20 May 2007 13:35:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HppJJ-00041i-9b for emacs-devel@gnu.org; Sun, 20 May 2007 13:35:13 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HppJI-0001a2-QY for emacs-devel@gnu.org; Sun, 20 May 2007 13:35:13 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1HppJ8-0008OK-6y for emacs-devel@gnu.org; Sun, 20 May 2007 19:35:02 +0200 Original-Received: from catv5403a040.pool.t-online.hu ([84.3.160.64]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 May 2007 19:35:02 +0200 Original-Received: from karoly by catv5403a040.pool.t-online.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 May 2007 19:35:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: catv5403a040.pool.t-online.hu User-Agent: Thunderbird 1.5.0.10 (X11/20070403) In-Reply-To: X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:71436 Archived-At: csant wrote: > Taking the freedom to report bugs specific to the multi-tty branch > directly to the emacs-devel list - I noticed an odd regression with > vcursor in the multi-tty branch . I have managed to boil it down to > this snippet from my ~/.emacs : > > (setq vcursor-key-bindings 't) > (load "vcursor") > (xterm-mouse-mode 1) > > When loading this in ~/.emacs on a startup with > $ ./src/emacs -nw > of a fresh compile of a checkout of the multi-tty branch, C-S-up > produces the character `A' instead of vcursor-previous-line . However, > when starting > $ ./src/emacs -Q -nw > and then finding that file and doing a `M-x eval-last-sexp' on each of > the three items above, everything works as expected . Also running in X > gives no problems . This doesn't seem related to vcursor at all. The simplest way to reproduce this that I could find is just having the following in .emacs: (load-library "xt-mouse") The bug is caused by some problem related to `local-function-key-map' during terminal initialization. .emacs is loaded *before* term/xterm.el sets up the local-function-key-map on the terminal, and apparently changing `function-key-map' before that breaks function keys. I think this may be related to keymap inheritance. On the multi-tty branch, `function-key-map' is the common parent of all terminal-local keymaps (`local-function-key-map'). To speed up terminal initialization, term/xterm.el prepares a third keymap with the terminal-dependent function keys (such as `xterm-function-map'), and set a copy of that as the intermediate parent of `local-function-key-map'. The result is as follows: function-key-map ^ | anonymous copy of xterm-function-map ^ | local-function-key-map Xterm-mouse-mode simply adds a new define-key in function-key-map. Apparently this doesn't work right when it does this before the above chain is created. `local-function-key-map' is different depending on whether xt-mouse is loaded before or after terminal initialization. This shouldn't happen. Unfortunately, I don't have time to debug this now. I'll return to this later, unless somebody else fixes it in the meantime. (It is very much possible that I simply misunderstood how keymap inheritance works when I wrote the above code.) -- Karoly