[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TAB in inferior-python-mode

From: Stephen Berman
Subject: TAB in inferior-python-mode
Date: Fri, 20 May 2016 11:46:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Doing the following (in either current emacs-25 or master built from the
Savannah repository):

0. emacs -Q
1. M-x run-python
2. at the Python prompt type `for i in range(10):' then `RET', `TAB',
   `print i,', `RET'

results in this Python error:

IndentationError: expected an indented block

although the TAB in step 2 above visibly indents the line `print i,'.
If instead of `TAB' I type `SPC SPC SPC SPC' then after the final RET
the output is as expected:

0 1 2 3 4 5 6 7 8 9

It's not clear to me whether the above error indicates a bug in
python.el or there some setting I've overlooked that makes TAB work in
inferior-python-mode.  (In case it matter, this is with python 2.7.8., I
haven't tried with python3.)  I note that the definition of python-mode
has this line:

(set (make-local-variable 'indent-tabs-mode) nil)

which the definition of inferior-python-mode lacks; adding that line to
latter does make TAB work as expected.  But I'm not sure that is the
appropriate way to deal with this.  Does anyone here know?

Steve Berman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]