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#13793: 24.3.50; M-x broken in viper and X Date: Tue, 26 Feb 2013 15:56:08 +0100 Message-ID: <20130226145608.GC31613@bayes.mathematik.tu-chemnitz.de> References: <20130223123501.43568c52@susi> <20130225201657.GA10969@susi> <20130226085741.GB31613@bayes.mathematik.tu-chemnitz.de> 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 1361890769 11043 80.91.229.3 (26 Feb 2013 14:59:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2013 14:59:29 +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 15:59:49 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 1UAM0R-00083R-SH for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Feb 2013 15:59:48 +0100 Original-Received: from localhost ([::1]:43564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAM07-0004Lo-3Z for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Feb 2013 09:59:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAM02-0004Kn-AZ for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 09:59:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UALzy-0003hS-JJ for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 09:59:22 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UALzy-0003hH-G6 for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 09:59:18 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UAM1f-00059s-8F for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 10:01:03 -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 15:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13793 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13793-submit@debbugs.gnu.org id=B13793.136189081619760 (code B ref 13793); Tue, 26 Feb 2013 15:01:03 +0000 Original-Received: (at 13793) by debbugs.gnu.org; 26 Feb 2013 15:00:16 +0000 Original-Received: from localhost ([127.0.0.1]:51461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAM0s-00058b-BZ for submit@debbugs.gnu.org; Tue, 26 Feb 2013 10:00:16 -0500 Original-Received: from mout1.freenet.de ([195.4.92.91]:35916) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAM0n-00058P-W8; Tue, 26 Feb 2013 10:00:12 -0500 Original-Received: from [195.4.92.141] (helo=mjail1.freenet.de) by mout1.freenet.de with esmtpa (ID frank-fischer@shadow-soft.de) (port 25) (Exim 4.80.1 #2) id 1UALz4-0005Ul-JN; Tue, 26 Feb 2013 15:58:22 +0100 Original-Received: from localhost ([::1]:53699 helo=mjail1.freenet.de) by mjail1.freenet.de with esmtpa (ID frank-fischer@shadow-soft.de) (Exim 4.80.1 #2) id 1UALz4-0005cs-CC; Tue, 26 Feb 2013 15:58:22 +0100 Original-Received: from [195.4.92.25] (port=32974 helo=15.mx.freenet.de) by mjail1.freenet.de with esmtpa (ID frank-fischer@shadow-soft.de) (Exim 4.80.1 #2) id 1UALwy-0000OC-NA; Tue, 26 Feb 2013 15:56:12 +0100 Original-Received: from bayes.mathematik.tu-chemnitz.de ([134.109.41.17]:38452) by 15.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 1UALwy-0004sf-Ig; Tue, 26 Feb 2013 15:56:12 +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:71844 Archived-At: On 02/26, Stefan Monnier wrote: > >> [ 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? > > I guess an advice might work (it probably wouldn't need to put the map > back, just let-bind a variable that causes the filter function to return > evil-normal-esc-map without bothering to sit-for). > But it doesn't sound very appealing. > > Maybe "enable evil-esc-mode in post-command-hook and disable it in > pre-command-hook" might work? I'm a little bit afraid of situations where a new binding is defined but pre-command-hook has not been called (to restore the original definition of `input-decode-map`). For example if a new binding is established in a hook or when Emacs starts. If evil is loaded before that binding is defined, i.e. input-decode-map is already 'patched', then it may fail. Of course one could start with an unpatched input-decode-map and wait for the first post-command-hook. So the question is: is it guaranteed that a post-command-hook will be called when Emacs starts and before any user input, and that a call to `define-key` will always be preceded by a pre-command-hook and followed by a post-command-hook, no matter how it is called? This includes any possibility to call `define-key` from a hook or so. I just do not have the overview to give a reliable judgement on this. IMO using an advice is more direct and simpler in this particular situation, although I really don't like it. Frank