From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: M-x mystery Date: Mon, 2 Jan 2012 08:34:33 -0800 Message-ID: <9FB2AF988B2F4C1389CB30235F2266A0@us.oracle.com> References: <20120102095123.F3895181003@neo.msri.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325524819 14152 80.91.229.12 (2 Jan 2012 17:20:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Jan 2012 17:20:19 +0000 (UTC) To: "'Silvio Levy'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 02 18:20:15 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RhlYU-00062Y-3H for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Jan 2012 18:20:14 +0100 Original-Received: from localhost ([::1]:57199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhlYT-0004jR-HB for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Jan 2012 12:20:13 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rhkqe-0008AD-Is for help-gnu-emacs@gnu.org; Mon, 02 Jan 2012 11:34:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RhkqZ-0007Sc-PJ for help-gnu-emacs@gnu.org; Mon, 02 Jan 2012 11:34:53 -0500 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:44470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhkqZ-0007SR-Ik for help-gnu-emacs@gnu.org; Mon, 02 Jan 2012 11:34:51 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q02GYleH024576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Jan 2012 16:34:48 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q02GYkXA007746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Jan 2012 16:34:47 GMT Original-Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q02GYkEw010869; Mon, 2 Jan 2012 10:34:46 -0600 Original-Received: from dradamslap1 (/10.159.57.64) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 02 Jan 2012 08:34:45 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20120102095123.F3895181003@neo.msri.org> Thread-Index: AczJNB0QL4rgxVm1QlOFkVNVU0ELowAMlgug X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090206.4F01DCA8.0083,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 148.87.113.117 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83291 Archived-At: > in trying to debug some bad interactions between vip.el (VI emulation) > and icicles, I've come against an obstable I can't surmount: M-x > sometimes ceases to be M-x and becomes instead ESC-x. > > Minimal example: I run "emacs -q -l foo.el" where foo.el > contains this code: > (defun doit () > "run test" > (interactive) > (defvar vip-mode-map (make-keymap)) > (define-key vip-mode-map "\e" 'kill-line) > (use-local-map vip-mode-map)) > > Then I into a scratch buffer and type M-x doit -- so far so good. > After that, when I type M-x the behavior, it is as if I had typed ESC > and x: the current line is killed and an x is inserted. > Any ideas about what I'm doing wrong? `M-x' is typically the same as `ESC x' (it is translated from `ESC x'). If you redefine `ESC' as a command (`kill-line') then it can no longer continue to act as a prefix key. So both `M-x' and `ESC x' are then undefined. (Also, why are you doing `make-keymap' here? Why is that necessary? Why not just invoke `doit' after you have loaded Vip, so the keymap will be already defined?) FYI: You can customize the key that Icicles uses to invoke `icicle-execute-extended-command' (by default it is `M-x'). Just customize option `icicle-top-level-key-bindings', changing the entry for that command. Anyway, I tried to follow your recipe. It seems incomplete. You start with `emacs -q`, which is good, but you do not show where/when you load vip.el[c] or Icicles, and you do not show where/when you turn on Vip mode or Icicles mode. Sometimes the load or mode-invocation order can matter (but it should not). When I do `emacs -Q', then load vip.el, then evaluate the code above and do `M-x doit', then load Icicles and turn on Icicle mode, I do not see the behavior you describe. If I then turn on Vip mode (using `M-x vip-mode' and answering `n' to inhibiting startup msg), I still do not see that behavior. If I toggle Icicle mode off then on again I still do not see that behavior. And I don't see any difference if I turn on vip-mode before Icicle mode, etc. The order does not seem to matter. `C-h k' says `M-x' and `ESC x' are undefined. But they both seem to work normally, invoking `icicle-execute-extended-command' in Icicle mode and `execute-extended-command' when I turn off Icicle mode! Yet looking at `vip-mode-map' I see that it has `ESC' defined as `kill-line'. But `C-h w kill-line' does not list `ESC' as one of the bindings. I get the impression that I am not really in Vip mode (?). And yet I see `Vi:' in the mode line. But `C-h m' does not mention Vip at all (?). I tried toggling Vip mode using `M-x vip-mode', but I still see `Vi:' in the mode line. I know nothing about Vip, so I'm probably not turning it off and on correctly. I took a quick look at the Vip doc, but it wasn't very helpful, IMHO. Please send me a more complete recipe, mentioning also your Emacs version. We can take this off list. But if someone else familiar with Vip can help, please post.