all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefano Zacchiroli <zack@upsilon.cc>
To: Michael Kifer <kifer@cs.sunysb.edu>
Cc: Romain Francoise <rfrancoise@debian.org>,
	1072@emacsbugs.donarmstrong.com
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	[thread overview]
Message-ID: <20081114134814.GA9550@usha.takhisis.invalid> (raw)
In-Reply-To: <20081007190607.32194926@kiferserv>

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.

-- 
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'è ..|  .  |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime






  parent reply	other threads:[~2008-11-14 13:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081006095245.2FE176A99@usha.takhisis.invalid>
     [not found] ` <20081006124104.25eb7619@kiferserv>
2008-10-07 14:49   ` bug#1072: Viper version is 3.14 of April 06, 2008; can't exit viper insert mode with ESC using emacsclient -t Stefano Zacchiroli
2008-10-07 16:21     ` Lennart Borgman (gmail)
2008-10-07 23:06       ` Michael Kifer
2008-10-07 23:56         ` Lennart Borgman (gmail)
2008-11-14 13:48         ` Stefano Zacchiroli [this message]
2008-11-14 19:50           ` Michael Kifer
2008-11-14 20:40             ` Dan Nicolaescu
2008-11-14 20:55               ` Michael Kifer
2008-11-14 21:22                 ` Dan Nicolaescu
2008-11-14 22:39                   ` Stefan Monnier
2008-11-14 22:46                     ` Michael Kifer
2008-11-15  1:32                       ` Stefano Zacchiroli
     [not found]                         ` <20081116000252.32203b3a@kiferserv>
2008-11-16 16:18                           ` Stefano Zacchiroli
2008-10-09  9:08       ` Stefano Zacchiroli
2008-10-09 14:24         ` Lennart Borgman (gmail)
2008-10-07 16:28     ` Michael Kifer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081114134814.GA9550@usha.takhisis.invalid \
    --to=zack@upsilon.cc \
    --cc=1072@emacsbugs.donarmstrong.com \
    --cc=kifer@cs.sunysb.edu \
    --cc=rfrancoise@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.