py-execute-line doesn't echo in shell

Asked by Shiyuan

Hi,
     I am using Emacs 24.3 under Ubuntu 14.04. I started emacs by `emacs -Q` so that there is no third party interference. When I use `py-execute-line` to send a line to the shell, the line is executed but the python shell doesn't echo the line. This seem weird. I found a similar case in stackoverflow, but there is no answer given: http://stackoverflow.com/questions/24150950/how-to-make-python-console-to-echo-the-lines-in-emacs-python-mode . This problem actually happens even in emacs built-in python mode(python.el). Any hints about what causes this problem? Thank you.

Shiyuan

Question information

Language:
English Edit question
Status:
Answered
For:
python-mode.el Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andreas Roehler (a-roehler) said :
#1

Am 23.08.2015 um 21:46 schrieb Shiyuan:
> New question #270723 on python-mode.el:
> https://answers.launchpad.net/python-mode/+question/270723
>
> Hi,
> I am using Emacs 24.3 under Ubuntu 14.04. I started emacs by `emacs -Q` so that there is no third party interference. When I use `py-execute-line` to send a line to the shell, the line is executed but the python shell doesn't echo the line. This seem weird. I found a similar case in stackoverflow, but there is no answer given: http://stackoverflow.com/questions/24150950/how-to-make-python-console-to-echo-the-lines-in-emacs-python-mode . This problem actually happens even in emacs built-in python mode(python.el). Any hints about what causes this problem? Thank you.
>
> Shiyuan
>
>
>

Can't reproduce. Please provide some example code which triggers the bug.

Revision history for this message
Shiyuan (gshy2014) said :
#2

The problem persists. I can reproduce the problem in multiple ubuntu 14.04 machine + emacs 24 .3.1. To ensure there is absolutely no interference of third party. I started with a fresh ubuntu 14.04. By "Fresh", I mean I only installed emacs by `apt-get install emacs24`. Then I did the following :

1). emacs -Q tmp.py
2). In tmp.py buffer:
a = 3 + 1
print a

3). C-c C-c which runs `python-shell-send-buffer`
4). Mini-buffer prompts: Run Python: /usr/bin/python -i
      Make dedicated process?(y or n) --- Y
      Mini-buffer prompts: sent-eldoc-setup-code
5). This is what is shown in the python shell buffer:
 --------------------------------------------------------------------------------------
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> >>> >>> 4
>>>
----------------------------------------------------------------------------------------
Note that the command executed is not shown but only the result. Is it the correct behavior? It seems straight. Can I make the shell buffer echo whatever commands sent to it? Thank you.

Revision history for this message
Shiyuan (gshy2014) said :
#3

Someone from emacs mailing list confirmed that this is indeed the default behavior of built-in python mode of emacs. I guess python-mode just "inherit" this behavior form emacs built-in python by default. Is there any setting I can use in python-mode to override this setting so that we can see the commands sent to the shell buffer

Revision history for this message
Andreas Roehler (a-roehler) said :
#4

Am 28.08.2015 um 22:51 schrieb Shiyuan:
> Question #270723 on python-mode.el changed:
> https://answers.launchpad.net/python-mode/+question/270723
>
> Shiyuan gave more information on the question:
> Someone from emacs mailing list confirmed that this is indeed the
> default behavior of built-in python mode of emacs. I guess python-mode
> just "inherit" this behavior form emacs built-in python by default. Is
> there any setting I can use in python-mode to override this setting so
> that we can see the commands sent to the shell buffer
>

With emacs -Q python-mode.el isn't loaded.

Revision history for this message
Shiyuan (gshy2014) said :
#5

Yes, I understand that with `emacs -Q`, python-mode.el isn't loaded. But even if python-model is loaded, I still don't see the command echo in python shell. Is this the correct behavior in python-mode? Can we see the command echo if python-mode is loaded and set up correctly? Thanks.

Revision history for this message
Andreas Roehler (a-roehler) said :
#6

That's not implemented, sorry. Wouldn't be that much to do it, patches welcome.

Revision history for this message
Andreas Roehler (a-roehler) said :
#7

Maybe consider to turn this into a bug report, which would serve as a feature request. See button.

Can you help with this problem?

Provide an answer of your own, or ask Shiyuan for more information if necessary.

To post a message you must log in.