[SciPy-user] Python mode in emacs 22 (Ubuntu Gutsy Gibbon)

William Henney whenney@gmail....
Mon Oct 22 11:10:16 CDT 2007


Ryan Krauss <ryanlists <at> gmail.com> writes:

> 
> It seems like emacs 21 was left installed and all that really had to
> be done was to change the symbolic link in /usr/bin to point to
> emacs21-x (after reinstalling python-mode).  So, the switch back was
> fairly painless in my experience.
> 
> On 10/21/07, Carl Trachte <ctrachte <at> gmail.com> wrote:
> > I don't have a solution, but I have experienced the same things with
> > emacs22.  For indenting I've been using the space key.  For commenting out,
> > I've been using rectangle editing (move the section over 3 spaces, then fill
> > with # characters).  I really ought to write shortcuts for these actions or
> > switch back to emacs21 like you suggested.
> >
> >
> > On 10/21/07, Ryan Krauss <ryanlists <at> gmail.com> wrote:
> > > O.K. something in my .emacs file was causing my problem.  I renamed it
> > > so it wouldn't load and deleted the .emacs.elc file and the file
> > > loaded correctly with the new built-in Python mode.  But it doesn't
> > > seem as powerful.  It doesn't scan for functions and classes and it
> > > doesn't auto-indent in for loops.  I think I have to remove emacs22
> > > and roll back to 21 and reinstall the other python-mode, unless
> > > someone has a better solution.
> > >

Hi Ryan, Carl, 

Strange that you have been having problems. I've been using emacs22's python.el
for ages with no trouble at all. At least, indention works fine: TAB for
auto-indent (repeated TAB to cycle between possibilities), "C-c <" and "C-c >"
to manually indent or outdent the region. For commenting out, what is wrong with
"C-3 M-;"? (this is emacs-wide, not python-specific). 

Not sure about about scanning for functions/classes though - do you mean
something like imenu or ecb? I haven't tried these with python - find-tag works
well enough for me. Automatic symbol completion and help strings work as well,
although this is not as nice as in ipython. What would be really good is if
someone could integrate ipython with emacs....

If you really prefer the old python-mode, why don't you just install that on
emacs22? Regressing to emacs21 seems a bit drastic...

There is a lot more info about the two modes at
http://www.emacswiki.org/cgi-bin/emacs-en/PythonMode 

Now I look at that, I see that other people have been having similar problems.
Seems the solution is to make sure you have transient mark mode turned on and
the latest version of python.el

Cheers

Will







More information about the SciPy-user mailing list