From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Frank Fischer Newsgroups: gmane.emacs.bugs Subject: bug#13709: bug#13793: 24.3.50; M-x broken in viper and X Date: Tue, 26 Feb 2013 09:57:42 +0100 Message-ID: <20130226085741.GB31613@bayes.mathematik.tu-chemnitz.de> References: <20130223123501.43568c52@susi> <20130225201657.GA10969@susi> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1361869312 26826 80.91.229.3 (26 Feb 2013 09:01:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2013 09:01:52 +0000 (UTC) Cc: 13793@debbugs.gnu.org, 13709@debbugs.gnu.org, Michael Kifer To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 26 10:02:15 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UAGQJ-0006o3-Ti for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Feb 2013 10:02:08 +0100 Original-Received: from localhost ([::1]:44020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAGPy-0004jm-Uo for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Feb 2013 04:01:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAGPm-0004hs-B0 for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 04:01:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAGPX-0001V4-BZ for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 04:01:34 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAGPX-0001Ul-7P for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 04:01:19 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UAGRC-0004IK-Dw for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 04:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Frank Fischer Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Feb 2013 09:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13709 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13709-submit@debbugs.gnu.org id=B13709.136186933016446 (code B ref 13709); Tue, 26 Feb 2013 09:03:02 +0000 Original-Received: (at 13709) by debbugs.gnu.org; 26 Feb 2013 09:02:10 +0000 Original-Received: from localhost ([127.0.0.1]:50553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAGQL-0004H8-UE for submit@debbugs.gnu.org; Tue, 26 Feb 2013 04:02:10 -0500 Original-Received: from mout1.freenet.de ([195.4.92.91]:45886) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAGQH-0004Gu-Qy; Tue, 26 Feb 2013 04:02:07 -0500 Original-Received: from [195.4.92.140] (helo=mjail0.freenet.de) by mout1.freenet.de with esmtpa (ID frank-fischer@shadow-soft.de) (port 25) (Exim 4.80.1 #2) id 1UAGOZ-000187-Gk; Tue, 26 Feb 2013 10:00:19 +0100 Original-Received: from localhost ([::1]:57545 helo=mjail0.freenet.de) by mjail0.freenet.de with esmtpa (ID frank-fischer@shadow-soft.de) (Exim 4.80.1 #2) id 1UAGOZ-0008Ro-7k; Tue, 26 Feb 2013 10:00:19 +0100 Original-Received: from [195.4.92.12] (port=37169 helo=2.mx.freenet.de) by mjail0.freenet.de with esmtpa (ID frank-fischer@shadow-soft.de) (Exim 4.80.1 #2) id 1UAGM9-0000z8-Bq; Tue, 26 Feb 2013 09:57:49 +0100 Original-Received: from bayes.mathematik.tu-chemnitz.de ([134.109.41.17]:38844) by 2.mx.freenet.de with esmtpsa (ID frank-fischer@shadow-soft.de) (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (port 465) (Exim 4.80.1 #2) id 1UAGM9-0007Yc-5X; Tue, 26 Feb 2013 09:57:49 +0100 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71835 Archived-At: On 02/25, Stefan Monnier wrote: > > Anyhow, the real problem is to "multiplex" the (kbd "ESC") event in > > the terminal. Any solution that sends 'escape instead of (kbd "ESC") > > if another event arrives within a short period should solve the > > problem. > > Now my question is: why do it with a minor-mode map rather than with > an input-decode-map (which would also save you from having to rely on > unread-command-events)? Oh, yes, of course, that input-decode-map > binding would collide with the escape-sequence remappings. > > How 'bout something like: > > (defvar evil-normal-esc-map (lookup-key input-decode-map [?\e])) > (define-key input-decode-map > [?\e] `(menu-item "" ,evil-normal-esc-map > :filter ,(lambda (map) > (if (sit-for evail-esc-delay) [escape] map)))) This is a really clever solution, thank you a lot. It looks much better than the current one. The Evil code is naturally "inspired" by viper's code, so the reasons for its current form are hidden in the shadows of history ;) I will build something like this into Evil, then we will see if it breaks something. > > [ Modulo some dance à la evil-esc-mode to add/remove this binding so > that code that adds escape sequences to this map never bumps into the > [escape] mapping. ] Maybe one question, because I'm not too familiar with translation keymaps. What do you think is the best solution to this add-escape-sequences-to-input-decode-map-problem? The only possibility that comes into my mind would be to advice `define-key` so that `evil-normal-esc-map` is temporarily put back into `input-decode-map`. Is there a better way than using such an advice? Once again, thank you a lot! Frank