all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: help-gnu-emacs@gnu.org
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)	[thread overview]
Message-ID: <gp5odv$10tp$1@colin2.muc.de> (raw)
In-Reply-To: 2ee748a7-49a3-4495-bc2d-2e663f8bcbbf@v15g2000yqn.googlegroups.com

In comp.emacs Xah Lee <xahlee@gmail.com> wrote:
> On Mar 6, 9:21?pm, Teemu Likonen <tliko...@iki.fi> 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	other threads:[~2009-03-10 13:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-07  3:27 how to change C-x prefix to C-k in a clean way? Xah Lee
2009-03-07  5:21 ` Teemu Likonen
2009-03-07 23:19   ` Xah Lee
2009-03-10 13:02     ` Alan Mackenzie [this message]
2009-03-10 18:42       ` Johan Bockgård
2009-03-10 22:50       ` Raoul Gough
2009-03-08 15:05 ` Michael Heerdegen
2009-03-11 15:36 ` rustom
2009-03-11 21:31   ` Xah Lee
2009-03-12 17:45     ` prad
  -- strict thread matches above, loose matches on Subject: below --
2009-03-12 13:40 Rustom Mody
     [not found] <mailman.3015.1237105221.31690.help-gnu-emacs@gnu.org>
2009-03-16  5:18 ` B. T. Raven
2009-03-16 13:17   ` rustom
2009-03-20  4:07     ` Xah Lee
2009-03-20 10:53     ` Rupert Swarbrick
2009-03-20  7:49 Rustom Mody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gp5odv$10tp$1@colin2.muc.de' \
    --to=acm@muc.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.