I’ve been trying teach myself emacs, and because I am using dvorak, I foolishly rebound C-c to a movement key and got used to it. Now i’m actually starting to do some programming with it, and I loaded up a python file and noticed that C-c is the prefix to all the special commands in python-mode.
Can I rebind the prefix key and change all python commands in one swoop in my init.el file? If not, should I rebind all the python commands individually?
If you look at the source code for python.el, you’ll see that the commands were added individually using the full specification, e.g.
(define-key map "\C-c\C-r" 'python-send-region).So, you’re going to have to redo them all yourself. That said it is pretty straight-forward. From your comment, you want to change the prefix key to be C-', and the trick to getting escaping right is to not use escapes at all, but instead to use the macro
kbd(documentation link).With that, you can update the mode-map definition to be: