technomancy / emacs-starter-kit

[ARCHIVED] this is ancient history
GNU General Public License v3.0
2.87k stars 887 forks source link

C-c x remap is F'd #96

Open milkypostman opened 12 years ago

milkypostman commented 12 years ago
[23:40:53] <technomancy> milkpost: in 2.0.2 it is. maybe C-h c M-x to check?
[23:41:01] <milkpost> yeah, it's messed up, i am fixing now
[23:41:14] <milkpost> i use C-x C-m for M-x
[23:41:45] <milkpost> technomancy: just found a bug: you have   (global-set-key (kbd "C-c x") 'execute-extended-command)
[23:41:54] <milkpost> which means C-c x is not getting mapped to smex
[23:42:59] <milkpost> technomancy: probably what you want is: (define-key key-translation-map (kbd "C-x c") (kbd "M-x"))
[23:43:35] <johnw> ooh, I never knew about the key-translation-map!!
[23:43:43] <technomancy> milkpost: oh, nice.
[23:43:48] <technomancy> can you open an issue?
[23:43:54] <milkpost> sure
[23:43:56] <technomancy> johnw: did you byte-compile smex?
[23:44:04] <milkpost> can I just copy and paste in this conversation? :)

I think you're looking to do (define-key key-translation-map (kbd "C-x c") (kbd "M-x"))

milkypostman commented 12 years ago

I don't think my previous suggestion is right. It'd probably work, but what you probably do want is,

(global-set-key (kbd "C-c x") (kbd "M-x")) 

I had similar problems and this was the way to go. By changing the key-translation-map you change the key everywhere which is not want you want. Because in some modes you want C-x c mapped completely different. It's not so much a problem here but I rebind things like C-h and the previous suggestion was bad news bears.

technomancy commented 12 years ago

Hm; I tried this and it turns C-c x into a no-op. This is on 24 from around the time of the first pretest.

milkypostman commented 12 years ago

I tried the previous suggestion of (define-key key-translation-map (kbd "C-x c") (kbd "M-x"))

It seems to work. Not sure why the latter doesn't. I have this in my init.el and it works,

(global-set-key (kbd "C-w") (kbd "M-<backspace>"))
(global-set-key (kbd "C-h") (kbd "<backspace>"))