Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3228968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:45:19+00:00 2026-05-17T16:45:19+00:00

I’ve been trying teach myself emacs, and because I am using dvorak, I foolishly

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:45:20+00:00Added an answer on May 17, 2026 at 4:45 pm

    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:

    (defvar python-mode-map
      (let ((map (make-sparse-keymap)))
        ;; Mostly taken from python-mode.el.
        (define-key map ":" 'python-electric-colon)
        (define-key map "\177" 'python-backspace)
        (define-key map (kbd "C-' <") 'python-shift-left)
        (define-key map (kbd "C-' >") 'python-shift-right)
        (define-key map (kbd "C-' C-k") 'python-mark-block)
        (define-key map (kbd "C-' C-d") 'python-pdbtrack-toggle-stack-tracking)
        (define-key map (kbd "C-' C-n") 'python-next-statement)
        (define-key map (kbd "C-' C-p") 'python-previous-statement)
        (define-key map (kbd "C-' C-u") 'python-beginning-of-block)
        (define-key map (kbd "C-' C-f") 'python-describe-symbol)
        (define-key map (kbd "C-' C-w") 'python-check)
        (define-key map (kbd "C-' C-v") 'python-check) ; a la sgml-mode
        (define-key map (kbd "C-' C-s") 'python-send-string)
        (define-key map (kbd "C-\\ M-x") 'python-send-defun)
        (define-key map (kbd "C-' C-r") 'python-send-region)
        (define-key map (kbd "C-' M-r") 'python-send-region-and-go)
        (define-key map (kbd "C-' C-c") 'python-send-buffer)
        (define-key map (kbd "C-' C-z") 'python-switch-to-python)
        (define-key map (kbd "C-' C-m") 'python-load-file)
        (define-key map (kbd "C-' C-l") 'python-load-file) ; a la cmuscheme
        (substitute-key-definition 'complete-symbol 'symbol-complete
                                   map global-map)
        (define-key map (kbd "C-' C-i") 'python-find-imports)
        (define-key map (kbd "C-' C-t") 'python-expand-template)
        (easy-menu-define python-menu map "Python Mode menu"
          `("Python"
            :help "Python-specific Features"
            ["Shift region left" python-shift-left :active mark-active
             :help "Shift by a single indentation step"]
            ["Shift region right" python-shift-right :active mark-active
             :help "Shift by a single indentation step"]
            "-"
            ["Mark block" python-mark-block
             :help "Mark innermost block around point"]
            ["Mark def/class" mark-defun
             :help "Mark innermost definition around point"]
            "-"
            ["Start of block" python-beginning-of-block
             :help "Go to start of innermost definition around point"]
            ["End of block" python-end-of-block
             :help "Go to end of innermost definition around point"]
            ["Start of def/class" beginning-of-defun
             :help "Go to start of innermost definition around point"]
            ["End of def/class" end-of-defun
             :help "Go to end of innermost definition around point"]
            "-"
            ("Templates..."
             :help "Expand templates for compound statements"
             :filter (lambda (&rest junk)
                       (abbrev-table-menu python-mode-abbrev-table)))
            "-"
            ["Start interpreter" python-shell
             :help "Run `inferior' Python in separate buffer"]
            ["Import/reload file" python-load-file
             :help "Load into inferior Python session"]
            ["Eval buffer" python-send-buffer
             :help "Evaluate buffer en bloc in inferior Python session"]
            ["Eval region" python-send-region :active mark-active
             :help "Evaluate region en bloc in inferior Python session"]
            ["Eval def/class" python-send-defun
             :help "Evaluate current definition in inferior Python session"]
            ["Switch to interpreter" python-switch-to-python
             :help "Switch to inferior Python buffer"]
            ["Set default process" python-set-proc
             :help "Make buffer's inferior process the default"
             :active (buffer-live-p python-buffer)]
            ["Check file" python-check :help "Run pychecker"]
            ["Debugger" pdb :help "Run pdb under GUD"]
            "-"
            ["Help on symbol" python-describe-symbol
             :help "Use pydoc on symbol at point"]
            ["Complete symbol" symbol-complete
             :help "Complete (qualified) symbol before point"]
            ["Find function" python-find-function
             :help "Try to find source definition of function at point"]
            ["Update imports" python-find-imports
             :help "Update list of top-level imports for completion"]))
        map))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.