Differences between revisions 3 and 4
Revision 3 as of 2002-12-20 12:36:52
Size: 687
Editor: iproxy7
Comment:
Revision 4 as of 2003-08-13 19:54:46
Size: 1549
Editor: 192
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Python Mode is part of the source distribution of Python (as the file Misc/python-mode.el) and a more recent version than the above release may be available through CVS. Python Mode is part of the source distribution of Python (as the file Misc/python-mode.el) and a more recent version than the above release may be available through CVS.

See EmacsWiki:PythonMode for information on how to install, configure and add shortcuts keys to python-mode.

== Python Mode FAQ ==

=== How can I run Uncomment Region? ===

The handy Uncomment Region command does not have a shortcut key. Actually, you can not run it from the command line at all! If you look into the python-mode description (C-h m), you will find that there is no such command.

There are two solutions:

 1. Prefix the Comment Region command with C-u, like this: C-u C-c #
 2. If you really want to save this extra C-u and have a shortcut like C-c 3, put this elisp code into your .emacs file:

{{{
;; The missing key shortcuts for Uncomment Region
  (add-hook 'python-mode-hook (lambda ()
    (define-key py-mode-map "\C-c3"
      (lambda (beg end) (interactive "r")
        (py-comment-region beg end '(4))))))
}}}

Python Mode is a major editing mode for the EmacsEditor.

The [http://www.python.org/emacs/python-mode/python-mode.el current release] is version 4.6 (~123KB). The list of changes since the last released version [http://www.python.org/emacs/python-mode/changes-406.html are given in detail], as well as some [http://www.python.org/emacs/python-mode/installation.html installation notes.] If you're having problems with font-lock in python-mode, read the [http://www.python.org/emacs/python-mode/faq.html FAQ.]

Python Mode is part of the source distribution of Python (as the file Misc/python-mode.el) and a more recent version than the above release may be available through CVS.

See PythonMode for information on how to install, configure and add shortcuts keys to python-mode.

Python Mode FAQ

How can I run Uncomment Region?

The handy Uncomment Region command does not have a shortcut key. Actually, you can not run it from the command line at all! If you look into the python-mode description (C-h m), you will find that there is no such command.

There are two solutions:

  1. Prefix the Comment Region command with C-u, like this: C-u C-c #
  2. If you really want to save this extra C-u and have a shortcut like C-c 3, put this elisp code into your .emacs file:

;; The missing key shortcuts for Uncomment Region
  (add-hook 'python-mode-hook (lambda () 
    (define-key py-mode-map "\C-c3" 
      (lambda (beg end) (interactive "r")
        (py-comment-region beg end '(4))))))

EmacsPythonMode (last edited 2020-11-25 22:12:14 by JonMoore)

Unable to edit the page? See the FrontPage for instructions.