From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: how to change C-x prefix to C-k in a clean way? Date: Tue, 10 Mar 2009 13:02:55 +0000 (UTC) Organization: muc.de e.V. Message-ID: References: <9f26e1db-d03a-47f8-a0ad-66d42d504df1@33g2000yqm.googlegroups.com> <87mybxnc0w.fsf@iki.fi> <2ee748a7-49a3-4495-bc2d-2e663f8bcbbf@v15g2000yqn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1236692448 23767 80.91.229.12 (10 Mar 2009 13:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Mar 2009 13:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 10 14:42:05 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lh2DS-0003TS-8B for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Mar 2009 14:41:54 +0100 Original-Received: from localhost ([127.0.0.1]:33766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lh2C6-00067D-Gn for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Mar 2009 09:40:30 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 38 Original-NNTP-Posting-Host: marvin.muc.de Original-X-Trace: colin2.muc.de 1236690175 33721 2001:608:1000::2 (10 Mar 2009 13:02:55 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: Tue, 10 Mar 2009 13:02:55 +0000 (UTC) User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE (i386)) Original-Xref: news.stanford.edu gnu.emacs.help:167501 comp.emacs:97984 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62808 Archived-At: In comp.emacs Xah Lee wrote: > On Mar 6, 9:21?pm, Teemu Likonen wrote: >> On 2009-03-06 19:27 (-0800), Xah Lee wrote: >> > is there a way to remap all the C-x key to another, say C-k? >> I think it's simply >> ? ? (global-set-key (kbd "C-k") ctl-x-map) >> See (info "(elisp) Prefix Keys") > that doesn't seems to work though. > I was excited for a moment, then it turns out not working. > When you do C-h v, it still consider C-x a prefix even if you set it > to nil... After that, bind C-x to whatever you want in the global map. Repeat for all other existing keymaps (mapatoms and keymap-p are your friends). Then you want to transform keybindings starting "\C-x.." in libraries you'll load later into "\C-k..". The best way here would be to add advice to `define-key', but this routine's written in C. Maybe the way to go here would be to change the name string "define-key" in keymap.c into, say, "xl-define-key", then write a "(defun define-key ...)" as a wrapper around it. And after that, remember to use `xl-define-key' for your own bindings. Whether you want this badly enough to go through all this hassle is another matter altogether. ;-) > Xah -- Alan Mackenzie (Nuremberg, Germany).