all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* no echo in python mode
@ 2015-08-23 16:38 Shiyuan
  2015-08-28 15:09 ` Shiyuan
  0 siblings, 1 reply; 3+ messages in thread
From: Shiyuan @ 2015-08-23 16:38 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,
     I am using GNU emacs 24.3.1 & python 2.7.6 under Ubuntu 14.04.  I
started the emacs by `emacs -Q file.py`. When I sent the selected region by
`C-c C-r` which runs(python-shell-send-region START END), the code is
executed but  the code is not echoed in the python shell. This seems weird.
Can I enabled the shell echoing for "python-shell-send-region". Thank you.

Shiyuan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: no echo in python mode
  2015-08-23 16:38 no echo in python mode Shiyuan
@ 2015-08-28 15:09 ` Shiyuan
  2015-08-28 17:20   ` John Mastro
  0 siblings, 1 reply; 3+ messages in thread
From: Shiyuan @ 2015-08-28 15:09 UTC (permalink / raw)
  To: help-gnu-emacs

A bit more details for reproducing the problem. 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`. Also there is no bash and emacs customer setup. 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? No echoing seems strange to me. Can I make the python
shell buffer echo whatever commands sent to it?

On Sun, Aug 23, 2015 at 12:38 PM, Shiyuan <gshy2014@gmail.com> wrote:

> Hi,
>      I am using GNU emacs 24.3.1 & python 2.7.6 under Ubuntu 14.04.  I
> started the emacs by `emacs -Q file.py`. When I sent the selected region by
> `C-c C-r` which runs(python-shell-send-region START END), the code is
> executed but  the code is not echoed in the python shell. This seems weird.
> Can I enabled the shell echoing for "python-shell-send-region". Thank you.
>
> Shiyuan
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: no echo in python mode
  2015-08-28 15:09 ` Shiyuan
@ 2015-08-28 17:20   ` John Mastro
  0 siblings, 0 replies; 3+ messages in thread
From: John Mastro @ 2015-08-28 17:20 UTC (permalink / raw)
  To: help-gnu-emacs

> 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? No echoing seems strange to me. Can I make the python
> shell buffer echo whatever commands sent to it?

Yes, that's the correct behavior. The shell prints the output but not
the input, as usual - the only difference is that in this case you type
the input into a `python-mode` buffer rather than an
`inferior-python-mode' buffer.

It seems like it should be possible to create a command that does what
you were expecting (take the text from the Python buffer, insert it into
the REPL buffer, and then `comint-send-input'), but AFAIK such a command
doesn't exist by default.

-- 
john



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-28 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-23 16:38 no echo in python mode Shiyuan
2015-08-28 15:09 ` Shiyuan
2015-08-28 17:20   ` John Mastro

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.