Switching from python-mode.el to python.el Switching from python-mode.el to python.el python python

Switching from python-mode.el to python.el


For what it's worth, I do not see the behavior you are seeing in issue #1, "Each buffer visiting a python file gets its own inferior interactive python shell."

This is what I did using python.el from Emacs 22.2.

C-x C-f foo.py[insert: print "foo"]

C-x C-f bar.py[insert: print "bar"]

C-c C-z [*Python* buffer appears]

C-x o

C-c C-l RET ["bar" is printed in *Python*]

C-x b foo.py RET

C-c C-l RET ["foo" is printed in the same *Python* buffer]

Therefore the two files are sharing the same inferior python shell. Perhaps there is some unforeseen interaction between your personal customizations of python-mode and the default behaviors of python.el. Have you tried using python.el without your .emacs customizations and checking if it behaves the same way?

The major feature addition of python.el over python-mode is the symbol completion function python-complete-symbol. You can add something like this

(define-key inferior-python-mode-map "\C-c\t" 'python-complete-symbol)

Then typing

>>> import os>>> os.f[C-c TAB]

you'll get a *Completions* buffer containing

Click <mouse-2> on a completion to select it.In this buffer, type RET to select the completion near point.Possible completions are:os.fchdir                          os.fdatasyncos.fdopen                          os.forkos.forkpty                         os.fpathconfos.fstat                           os.fstatvfsos.fsync                           os.ftruncate

It'll work in .py file buffers too.


  1. I can't reproduce this behavior on Emacs v23.1, this must have been changed since then.

  2. Forget about any mode's skeleton support and use the hyper-advanced and extensible yasnippet instead, it's really worth a try!


Note nearly everything said here is obsolete meanwhile as things changed.

python-mode.el commands are prefixed "py-" basically, you should be able to use commands from both, nonewithstanding which one was loaded first.

python-mode.el does not unload python.el; beside of python-mode-map, which is re-defined.

The diff is in the menu displayed and keysetting however, the last one loaded will determine.