Differences between revisions 13 and 14
Revision 13 as of 2011-06-30 10:47:27
Size: 4017
Comment: While unifying remains an option, current development at GNU's makes ending up with a third mode more probable IMHO. At the moment seeing three quite different cores, while the API is similar - as fa
Revision 14 as of 2012-09-16 08:07:41
Size: 4619
Editor: OleksandrGavenko
Comment: wiki restore 2013-01-23
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 3: Line 4:
Emacs (the major flavors being GnuEmacs and XEmacs) is a text editor which
come with good support for writing Python code.  Each has its strengths and
weaknesses, but in general either provide very nice environments for the
Python programmer.

Emacs (the major flavors being [[GnuEmacs|GnuEmacs]] and XEmacs) is a text editor which come with good support for writing Python code. Each has its strengths and weaknesses, but in general either provide very nice environments for the Python programmer.
Line 10: Line 10:
For stupid historical reasons, GnuEmacs and XEmacs come with different major
mode for editing Python code, though both do a fine job of it.
Please [[http://mail.python.org/mailman/listinfo/python-mode|get involved]] if
you want to help.

For stupid historical reasons, [[GnuEmacs|GnuEmacs]] and XEmacs come with different major mode for editing Python code, though both do a fine job of it. Please [[http://mail.python.org/mailman/listinfo/python-mode|get involved]] if you want to help.
Line 17: Line 16:
  * EmacsPythonMode, a major mode for programming Python in Emacs. 
    * Rudimentary completion is implemented on top of EmacsPythonMode by EmacsPythonCompletion
  * python.el, a Python mode which will be included when Emacs 22 is released, with a number of advantages over python-mode.el. For a version with fixes and enhancements (as of 2006-06) and one that works with Emacs 21, see [[http://www.loveshack.ukfsn.org/emacs]].
  * Emacs GUD PDB, support for sourcelevel debugging of Python code in Emacs. (Note: thanx to Ganesan R: Create the following script with the file name as "pdb" in your path so emacs can find pdb and default to filename arguments in the current dirctory: exec python /usr/lib/python2.3/pdb.py "$@")
  * [[http://www.iro.umontreal.ca/~pinard/pymacs/Pymacs.tar.gz|Pymacs(download)]], an extension for allowing Emacs users to extend Emacs using Python, where they might have traditionally used Emacs LISP. ' There are also [[EmacsWiki:PyMacs|PyMacs notes on the Emacs wiki.]]
  * [[http://home.exetel.com.au/peterm|Emacs Language Sensitive Editor (ELSE)]], an template-based minor mode for Emacs, with templates for Python.
  * [[http://sourceforge.net/projects/oo-browser/|OO-Browser]], an Emacs class browser for object-oriented languages with support for Python.
  * The [[http://www.cs.cornell.edu/home/raman/emacspeak|emacspeak audio desktop]] is a speech interface that allows visually impaired users to interact independently and efficiently with the computer. It has editing support for interactive Python development. Features aural highlighting, structured browsing and debugging. 

* [[EmacsPythonMode|EmacsPythonMode]], a major mode for programming Python in Emacs.
  * Rudimentary completion is implemented on top of [[EmacsPythonMode|EmacsPythonMode]] by [[EmacsPythonCompletion|EmacsPythonCompletion]]

* python.el, a Python mode which will be included when Emacs 22 is released, with a number of advantages over python-mode.el. For a version with fixes and enhancements (as of 2006-06) and one that works with Emacs 21, see http://www.loveshack.ukfsn.org/emacs.
 * Emacs GUD PDB, support for sourcelevel debugging of Python code in Emacs. (Note: thanx to Ganesan R: Create the following script with the file name as "pdb" in your path so emacs can find pdb and default to filename arguments in the current dirctory: exec python /usr/lib/python2.3/pdb.py "$@")
 * [[http://www.iro.umontreal.ca/~pinard/pymacs/Pymacs.tar.gz|Pymacs(download)]], an extension for allowing Emacs users to extend Emacs using Python, where they might have traditionally used Emacs LISP. ' There are also [[EmacsWiki:cgi-bin/wiki.pl?PyMacs|PyMacs notes on the Emacs wiki.]]
 * [[http://rope.sourceforge.net/ropemacs.html|ropemacs]] is a plugin for performing python refactorings in emacs. It uses rope library and pymacs.
* [[http://home.exetel.com.au/peterm|Emacs Language Sensitive Editor (ELSE)]], an template-based minor mode for Emacs, with templates for Python.
 * [[http://sourceforge.net/projects/oo-browser/|OO-Browser]], an Emacs class browser for object-oriented languages with support for Python.
 * The [[http://www.cs.cornell.edu/home/raman/emacspeak|emacspeak audio desktop]] is a speech interface that allows visually impaired users to interact independently and efficiently with the computer. It has editing support for interactive Python development. Features aural highlighting, structured browsing and debugging.
Line 28: Line 31:
Both Emacs and XEmacs have support for developers hacking on the Python C code
itself.
If you're developing Python 2.x, just use the standard `python` style
that comes with c-mode.  If you're hacking on Python 3.x, you'll want to add
the following code to your `.emacs` file (given by
[[http://mail.python.org/pipermail/python-dev/2008-May/079582.html|Georg Brandl]]):

Both Emacs and XEmacs have support for developers hacking on the Python C code itself. If you're developing Python 2.x, just use the standard `python` style that comes with c-mode. If you're hacking on Python 3.x, you'll want to add the following code to your `.emacs` file (given by [[http://mail.python.org/pipermail/python-dev/2008-May/079582.html|Georg Brandl]]):



Line 64: Line 68:
Line 65: Line 70:
Line 68: Line 74:
  * [[EmacsWiki:SiteMap|The Emacs Wiki]], a good starting place.
  * [[http://www.gnu.org/software/emacs/emacs.html|GnuEmacs web page]].
  * [[http://www.xemacs.org|XEmacs web page]].

 * [[EmacsWiki:cgi-bin/wiki.pl?SiteMap|The Emacs Wiki]], a good starting place. Look for relevant articles:
  * [[EmacsWiki:cgi-bin/wiki.pl?PythonProgrammingInEmacs|PythonProgrammingInEmacs]].
  * [[EmacsWiki:cgi-bin/wiki.pl?ProgrammingWithPythonDotEl|ProgrammingWithPythonDotEl]].
  * [[EmacsWiki:cgi-bin/wiki.pl?ProgrammingWithPythonModeDotEl|ProgrammingWithPythonModeDotEl]].

 * [[http://www.gnu.org/software/emacs/emacs.html|GnuEmacs web page]].
 * [[http://www.xemacs.org|XEmacs web page]].

Line 72: Line 85:
CategoryEditors
[[
CategoryEditors|CategoryEditors]]

Emacs

Emacs (the major flavors being GnuEmacs and XEmacs) is a text editor which come with good support for writing Python code. Each has its strengths and weaknesses, but in general either provide very nice environments for the Python programmer.

Tools for Python coders

For stupid historical reasons, GnuEmacs and XEmacs come with different major mode for editing Python code, though both do a fine job of it. Please get involved if you want to help.

Some tools have been written for using Python from Emacs:

  • EmacsPythonMode, a major mode for programming Python in Emacs.

  • python.el, a Python mode which will be included when Emacs 22 is released, with a number of advantages over python-mode.el. For a version with fixes and enhancements (as of 2006-06) and one that works with Emacs 21, see http://www.loveshack.ukfsn.org/emacs.

  • Emacs GUD PDB, support for sourcelevel debugging of Python code in Emacs. (Note: thanx to Ganesan R: Create the following script with the file name as "pdb" in your path so emacs can find pdb and default to filename arguments in the current dirctory: exec python /usr/lib/python2.3/pdb.py "$@")
  • Pymacs(download), an extension for allowing Emacs users to extend Emacs using Python, where they might have traditionally used Emacs LISP. ' There are also PyMacs notes on the Emacs wiki.

  • ropemacs is a plugin for performing python refactorings in emacs. It uses rope library and pymacs.

  • Emacs Language Sensitive Editor (ELSE), an template-based minor mode for Emacs, with templates for Python.

  • OO-Browser, an Emacs class browser for object-oriented languages with support for Python.

  • The emacspeak audio desktop is a speech interface that allows visually impaired users to interact independently and efficiently with the computer. It has editing support for interactive Python development. Features aural highlighting, structured browsing and debugging.

Support for C Python core developers

Both Emacs and XEmacs have support for developers hacking on the Python C code itself. If you're developing Python 2.x, just use the standard python style that comes with c-mode. If you're hacking on Python 3.x, you'll want to add the following code to your .emacs file (given by Georg Brandl):

(c-add-style
  "python-new"
  '((indent-tabs-mode . nil)
    (fill-column      . 78)
    (c-basic-offset   . 4)
    (c-offsets-alist  . ((substatement-open . 0)
                         (inextern-lang . 0)
                         (arglist-intro . +)
                         (knr-argdecl-intro . +)))
    (c-hanging-braces-alist . ((brace-list-open)
                               (brace-list-intro)
                               (brace-list-close)
                               (brace-entry-open)
                               (substatement-open after)
                               (block-close . c-snug-do-while)))
    (c-block-comment-prefix . "* "))
  )

;; This is a very crude hook that auto-selects the C style depending on
;; whether it finds a line starting with tab in the first 3000 characters
;; in the file
(defun c-select-style ()
   (save-excursion
     (if (re-search-forward "^\t" 3000 t)
         (c-set-style "python")
       (c-set-style "python-new"))))
(add-hook 'c-mode-hook 'c-select-style)

Note: We should try to get the style into upstream c-mode.

Other resources


CategoryEditors

EmacsEditor (last edited 2016-02-12 22:31:29 by OleskandrGavenko)

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