[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Any hope of being able to redefine C-x without problems???
From: |
Jesper Harder |
Subject: |
Re: Any hope of being able to redefine C-x without problems??? |
Date: |
Sun, 21 Sep 2003 21:38:07 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
Jesper Harder <harder@myrealbox.com> writes:
> seberino@spawar.navy.mil (Christian Seberino) writes:
>
>> There is no way to write some lisp code that makes me able to
>> define C-x and alter gdb to not have a problem? I thought you
>> could do anything in elisp?
>
> It's possible. But `C-x' is used as prefix by hundreds of basic
> Emacs functions -- not just gdb. You'll have redefine the bindings
> for all of them.
>
> A lot of tedious work for something which can easily be avoided by
> using another key-binding which is guaranteed not to conflict with any
> pre-defined Emacs bindings.
OK, it's not so tedious after all. If you want to bind a function,
say, `my-function' to `C-x' you can do this:
(keyboard-translate ?\C-x 'foo)
(global-set-key [foo] 'my-function)
If you need to call a function that's normally bound to a C-x sequence
you can redefine another key, e.g. F5, to act as C-x:
(define-key key-translation-map [f5] "\C-x")
Then you can type `F5 C-f' to call `find-file' which is bound to
`C-x C-f'.