From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefano Zacchiroli Newsgroups: gmane.emacs.bugs Subject: bug#1072: Viper version is 3.14 of April 06, 2008; can't exit viper insert mode with ESC using emacsclient -t Date: Fri, 14 Nov 2008 14:48:14 +0100 Message-ID: <20081114134814.GA9550@usha.takhisis.invalid> References: <20081006095245.2FE176A99@usha.takhisis.invalid> <20081006124104.25eb7619@kiferserv> <20081007144950.GA20151@usha.takhisis.invalid> <48EB8C94.2070403@gmail.com> <20081007190607.32194926@kiferserv> Reply-To: Stefano Zacchiroli , 1072@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1226671841 11239 80.91.229.12 (14 Nov 2008 14:10:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2008 14:10:41 +0000 (UTC) Cc: Romain Francoise , 1072@emacsbugs.donarmstrong.com To: Michael Kifer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 14 15:11:40 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 1L0zOY-0000mx-NS for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 15:11:35 +0100 Original-Received: from localhost ([127.0.0.1]:47116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0zNQ-0004Kz-Fq for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 09:10:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0zNH-0004Hl-31 for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:10:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0zNF-0004Gd-3h for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:10:14 -0500 Original-Received: from [199.232.76.173] (port=54177 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0zNE-0004GY-Uy for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:10:13 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42367) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L0zNE-0003op-UT for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:10:13 -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 mAEEA7fb005693; Fri, 14 Nov 2008 06:10:08 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mAEDt4GX001050; Fri, 14 Nov 2008 05:55:04 -0800 X-Loop: don@donarmstrong.com Resent-From: Stefano Zacchiroli Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Nov 2008 13:55:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1072 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1072-submit@emacsbugs.donarmstrong.com id=B1072.122667049932174 (code B ref 1072); Fri, 14 Nov 2008 13:55:04 +0000 Original-Received: (at 1072) by emacsbugs.donarmstrong.com; 14 Nov 2008 13:48:19 +0000 Original-Received: from fettunta.fettunta.org (fettunta.fettunta.org [67.207.129.222]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAEDmGZu032168 for <1072@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 05:48:17 -0800 Original-Received: from usha.takhisis.invalid (unknown [10.17.0.18]) by fettunta.fettunta.org (Postfix) with ESMTP id 80E101812E; Fri, 14 Nov 2008 13:48:15 +0000 (UTC) Original-Received: by usha.takhisis.invalid (Postfix, from userid 1000) id 978D361A8; Fri, 14 Nov 2008 14:48:14 +0100 (CET) Content-Disposition: inline In-Reply-To: <20081007190607.32194926@kiferserv> User-Agent: Mutt/1.5.18 (2008-05-17) X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id mAEEA7fb005693 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 14 Nov 2008 09:10:14 -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:22338 Archived-At: OK, mainly thanks to Romain Francoise, I've made some progress on the understanding of this bug. Romain pointed me to the fact that viper initialization depends on whether *when Emacs start* an X11 environment is in use or not. The client/server architecture offered by emacsclient and by --daemon defeats the soundness of this approach. To solve the problem once and for all we need per-client initialization so that when a terminal client is used Viper can be initialized _locally_ with terminal settings, dually when a X11 client is used. The workaround that Romain proposed to me is to add *before* Viper is loaded the following line in my ~/.emacs (setq viper-ESC-key (kbd "ESC")) ;; workaround for #1072 I don't know why :-) , but it solves *part* of the problem. Still, the behavior of key bindings starting with "M-" is broken. AFAIU the reason is that viper-ESC-keyseq-timeout is either set to 0 (which is good for X11) or to 200 (which is good for terminals). As I typically run the main Emacs in X11, my typical value is 0; when I spawn terminal clients attached to that Emacs they inherit the value and stuff like "M-x" first deliver an ESC which makes Viper quit insert mode. A possible solution would be to use hooks that set viper-ESC-keyseq-timeout appropriately depending on the kind of spawned client, but there are two sub-problems inhibiting them: 0) (my ignorance, probably not really a problem) I'm aware of the hook after-create-frame-functions, which can be used to hook the timeout to 0 for X11 clients, but I'm not aware of the equivalent for console clients, is there one? 1) viper-ESC-keyseq-timeout is a global variable, shared by all Emacs clients, can it be made local to a buffer (actually it would be enough to make it local to a client, but I don't believe it is possible), or there is some Viper magic which would defeat this solution not work? For the moment I'm stuck at exiting from Viper insert mode before being able to type M-something ... Cheers. --=20 Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'=E8 ..| . |. Et ne m'en veux pas si je te tutoi= e sempre uno zaino ...........| ..: |.... Je dis tu =E0 tous ceux que j'aim= e