2

I can't seem to rebind ctrl-ret in Emacs. I searched Google extensively, but in the few cases where there was some example of how to rebind it, that example didn't work. I want to unset the current binding, and replace it with a new one. How do I do this?

EpsilonVector
  • 3,973
  • 7
  • 38
  • 62

1 Answers1

4

I searched Google extensively, but in the few cases where there was some example of how to rebind it, that example didn't work.

What did you try that didn't work? This works for me in Emacs 24 on Windows 7:

(global-set-key [(control return)] 'foobar)

Update: cua-mode uses define-key, try this instead:

(define-key cua-global-keymap cua-rectangle-mark-key 'foobar)
Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
  • Exactly this. ctrl-ret is still bound to cua-set-rectangle-mark. – EpsilonVector Apr 25 '12 at 13:04
  • OK, think this is a special case, see my update. Also see this question: http://stackoverflow.com/questions/3750332/how-do-i-force-a-binding-in-emacs – Luke Girvin Apr 25 '12 at 13:19
  • I didn't get a chance to try your suggestion since I found the post you linked to about a minute ago, but I'll accept for linking to the post – EpsilonVector Apr 25 '12 at 13:28
  • 1
    Well worth reading: http://www.masteringemacs.org/articles/2011/02/08/mastering-key-bindings-emacs/ – phils Apr 25 '12 at 21:19