[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to change C-x prefix to C-k in a clean way?

From: Alan Mackenzie
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)
User-agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE (i386))

In comp.emacs Xah Lee <address@hidden> wrote:
> On Mar 6, 9:21?pm, Teemu Likonen <address@hidden> 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).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]