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 10:26:08 -0800 Message-ID: <29571DAF1C4F487BBEFB5FA21AEDA3DD@us.oracle.com> References: Your message of Mon, 2 Jan 2012 08:34:33 -0800 <20120102173715.D8C94180B85@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 1325528795 8374 80.91.229.12 (2 Jan 2012 18:26:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Jan 2012 18:26:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 02 19:26:31 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 1Rhmac-0005ZP-Tu for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Jan 2012 19:26:31 +0100 Original-Received: from localhost ([::1]:56165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rhmac-0007hh-El for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Jan 2012 13:26:30 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhmaX-0007gi-1D for help-gnu-emacs@gnu.org; Mon, 02 Jan 2012 13:26:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RhmaV-0004DY-Nx for help-gnu-emacs@gnu.org; Mon, 02 Jan 2012 13:26:25 -0500 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:39480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhmaV-0004DU-HW for help-gnu-emacs@gnu.org; Mon, 02 Jan 2012 13:26:23 -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 q02IQL4T015213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Jan 2012 18:26:22 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 q02IQK8I026773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Jan 2012 18:26:21 GMT Original-Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q02IQKss024458; Mon, 2 Jan 2012 12:26:20 -0600 Original-Received: from dradamslap1 (/10.159.57.64) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 02 Jan 2012 10:26:20 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20120102173715.D8C94180B85@neo.msri.org> Thread-Index: AczJdS2VuF+gbgXWQ5q7Qx0i6xZ6PgAAsRmQ 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.0A090203.4F01F6CE.0094,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:83294 Archived-At: > And that's what I don't understand. It's one thing for x to be > treated as M-x because some people lack that alt key, but for emacs to > *convert* the keycode x to x seems to me like poor design. That's just what Emacs does, and it always has. (This much has nothing to do with Icicles.) See user option `meta-prefix-char', which is bound by default to ESC (character value 27). See also the Elisp manual, node `Functions for Key Lookup'. (You might also look at node `Other Char Bits', about the Alt key.) I'm no expert on Emacs's `Meta' key and the `Alt' key. No doubt others could inform you better about this. In particular, perhaps a Vip or Viper user can help you here. > Why is it poor design? This is where I need to explain my motivation > for rebinding . > > Vi makes a distinction between insert mode and command mode. The fact > that (standard) emacs treats undecorated keys as self-insertion is in > my view its only major design flaw, and one that is neatly remedied by > vi emulation. In vi, undecorated keys are used for all sorts of > purposes, like moving around the file, which avoid having to reach for > the control key for every damn thing. Naturally, when you're adding > text you want these same keys to self-insert; ergo, there is an insert > mode. And in insert mode, ESC means "get me out of insert mode". > > So that's why vip rebinds ESC (when in insert mode). Icicle disables > that. I wonder how. Are you sure it does? I believe there are some people who use Icicles with Viper (dunno about Vip). By default (see my previous mail about customizing this), Icicles remaps command `execute-extended-command' to `icicle-execute-extended-command' when in Icicle mode. If you use Emacs 22+ (you still haven't said what Emacs version you are using), then this is done using `remap' with `define-key'. If you are using Emacs < 22 then this is done using `substitute-key-definition'. In effect, this rebinds `M-x' to the Icicles version of the command. And AFAIK this remapping means that all keys normally bound to `execute-extended-command' are rebound - and that includes `ESC x'. But I'm not aware where Icicles binds `ESC' - it remains a prefix key, but I don't believe that Icicles redefines it as a prefix key if you have undefined it as such by binding it to a command (e.g. `kill-line'). In any case, you should be able to customize the binding of `icicle-execute-extended-command', as I mentioned. As I said, my attempt to repro your problem failed - I guess I need a more detailed recipe. When I tried to follow your recipe, `M-x' still behaved normally, invoking `(icicle-)execute-extended-command' in and out of Icicle mode. AFAICT, I was never really in Vip mode (?). > So I was trying to rebind vip-change-to-vi-mode (get out of > insert mode) away from ESC to, say, , which is close to ESC on the > keyboard -- close enough that I can live with it. But nothing I did > worked. It might be easier to leave Vip alone and customize Icicles. Follow up off list, if you like. Let me know in detail (in order) what goes wrong when you make no changes to either, and I can perhaps tell you how to customize Icicles to help the two get along well. Or perhaps a Vipian or Viperian on the list can help. > And in trying to figure out why, I'm frustrated by the fact that > x is disabled by vip's rebinding of ESC. And **that's** the > problem I'm trying to solve first. I have a hard time imagining that > emacs cannot be persuaded to recognize x separately from . See above. See option `meta-prefix-char'. And can you please give me a more detailed recipe that will let me repro the problem? When and how do you activate Vip and Icicles etc. See my previous reply. Thx - Drew.