all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* detect prompt change for interactive python
@ 2008-07-16 18:53 gamename
  2008-07-17  5:34 ` Kevin Rodgers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gamename @ 2008-07-16 18:53 UTC (permalink / raw)
  To: help-gnu-emacs


Hi,

My normal prompt is "> ".  When I start python interactively with
"python -i", the prompt is now set to ">>> ".

Everything works fine except when I try to recall the previous
commands with "comint-previous-input".  The previous command is
restored to a position just after the first ">" sign.

Here are some examples.

bash prompt:
> oldCmdRecalled

python interactive:
>oldCmdRecalled>>

behavior I want:
>>> oldCmdRecalled

How do I dynamically set the buffer to accept ">>>" as a prompt and
restore commands in the correct spot?

THanks
-T


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

* Re: detect prompt change for interactive python
  2008-07-16 18:53 detect prompt change for interactive python gamename
@ 2008-07-17  5:34 ` Kevin Rodgers
  2008-07-17  6:03 ` Thierry Volpiatto
       [not found] ` <mailman.14882.1216274764.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2008-07-17  5:34 UTC (permalink / raw)
  To: help-gnu-emacs

gamename wrote:
> Hi,
> 
> My normal prompt is "> ".  When I start python interactively with
> "python -i", the prompt is now set to ">>> ".
> 
> Everything works fine except when I try to recall the previous
> commands with "comint-previous-input".  The previous command is
> restored to a position just after the first ">" sign.
> 
> Here are some examples.
> 
> bash prompt:
>> oldCmdRecalled
> 
> python interactive:
>> oldCmdRecalled>>
> 
> behavior I want:
>>>> oldCmdRecalled
> 
> How do I dynamically set the buffer to accept ">>>" as a prompt and
> restore commands in the correct spot?

Both shell-mode and inferior-python-mode are based on comint-mode, so
`C-h v comint-prompt-regexp'.  But I suspect what you really want is
`M-x run-python'.

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: detect prompt change for interactive python
  2008-07-16 18:53 detect prompt change for interactive python gamename
  2008-07-17  5:34 ` Kevin Rodgers
@ 2008-07-17  6:03 ` Thierry Volpiatto
       [not found] ` <mailman.14882.1216274764.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Thierry Volpiatto @ 2008-07-17  6:03 UTC (permalink / raw)
  To: gamename; +Cc: help-gnu-emacs

gamename <namesagame-usenet@yahoo.com> writes:

> Hi,
>
> My normal prompt is "> ".  When I start python interactively with
> "python -i", the prompt is now set to ">>> ".
>
> Everything works fine except when I try to recall the previous
> commands with "comint-previous-input".  The previous command is
> restored to a position just after the first ">" sign.
>
> Here are some examples.
>
> bash prompt:
>> oldCmdRecalled
>
> python interactive:
>>oldCmdRecalled>>
>
> behavior I want:
>>>> oldCmdRecalled
>
> How do I dynamically set the buffer to accept ">>>" as a prompt and
> restore commands in the correct spot?

Instead of calling python -i in a shell, use `py-shell' if you use
python-mode or if you use python.el (the emacs default) `python-shell'.
NOTE:python-mode is much better, you can use it with ipython.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




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

* Re: detect prompt change for interactive python
       [not found] ` <mailman.14882.1216274764.18990.help-gnu-emacs@gnu.org>
@ 2008-07-18 17:32   ` gamename
  0 siblings, 0 replies; 4+ messages in thread
From: gamename @ 2008-07-18 17:32 UTC (permalink / raw)
  To: help-gnu-emacs


Thanks, guys.

-T


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

end of thread, other threads:[~2008-07-18 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 18:53 detect prompt change for interactive python gamename
2008-07-17  5:34 ` Kevin Rodgers
2008-07-17  6:03 ` Thierry Volpiatto
     [not found] ` <mailman.14882.1216274764.18990.help-gnu-emacs@gnu.org>
2008-07-18 17:32   ` gamename

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.