I am working with python code, and I would like to be able to evaluate it in an emacs buffer, rather than using another terminal window. I am working with the python-mode
from python.el
, bundled with emacs.
This works just fine with emacs 24.3 on two different computers (windows and linux). However, I cannot get it to work on a 4rd computer with emacs 24.4: after spawning the buffer, it only shows completion candidates for an empty string (even though I didn't ask for any completion), and if I send a string, be it from a python-mode
buffer or directly in the comint
buffer, it just shows this list of completions again, and not the result of the command.
What's even more troubling is that according to google results, I am the only one with this issue, yet it is out-of-the-box experience!
Here are some screenshots with emacs -Q
:
Bottom of the output:
Top of the output:
I am using emacs 24.4.1 on linux, and the problem appears with both python 2.7.9 and python 3.4.1.
Any clue?
Edit 1 Thanks to Ista's answer, I was able to check that there is nothing different in my *Messages*
or in the content of variables python-shell-interpreter
, python-shell-interpreter-args
, python-shell-completion-setup-code
, python-ffap-setup-code
or python-eldoc-setup-code
when compared to a working setup.
Edit 2 Thanks to a comment by Ista, I tried with a new user, and the problem didn't appear! I have tried restoring various settings to default (notably desktop-wide shortcuts), but without success for now.
Edit 3 I also tried with the ipython
interpreter, the result is the same.
Edit 4 I tried starting python
from eshell
, shell
and term
(line-mode
), it has the same problem: when I enter 2+2;
and press RET
, I see a list of completions instead of 4
. term
with char-mode
works fine.
Overall, it looks like emacs sends a <TAB>
to the inferior process whenever it tries to interact with it.
C-c C-p
(run-python
) I see the output of the screenshots with just this command. Sending a string, either withC-c C-c
or by typing it in the inferior buffer, only causes this output to appear again. And as far as I know, there is no other report, which is the strangest part.