Problem with Emacs mode, at start only

François Pinard pinard at
Thu Feb 17 09:58:39 EST 2000

"Thomas A. Bryan" <tbryan at> écrit:
> François Pinard wrote:
> > Justin Sheehy <dworkin at> écrit:
> > > François Pinard <pinard at> writes:

> > > > When, in Emacs, I do not have `*Python*' window initialised, or
> > > > more precisely, when there is no process running in that window,
> > > > then `C-c C-c' in the window where is the Python source invariably
> > > > fails the first time,

> > > Whenever I start using python-mode, I do a `C-c !' to start the Python
> > > interpreter.  Subsequent invocations of `C-c C-c' or `C-c |' will use
> > > that interpreter window.

> > Thanks, it's neater.  But yet, shouldn't `C-c C-c' just succeed?  The user
> > should ideally not be forced into that extra, introductory command.

> Yes, it should.  I'm not sure what you mean when you say "more precisely,
> when there is no process running in that window."

Since `C-c C-c' in the wrong window kills Python, the process disappears,
and then, the next `C-c C-c' in the source window will trigger the process
to restart, with an error, forcing a second `C-c C-c'.

> In general, when I run C-c C-c before I start the interpreter with a
> C-c !, there is no '*Python*' buffer.  The C-c C-c command creates a
> '*Python Output*' buffer to display any output, but it doesn't start a
> Python shell and doesn't create a '*Python*' buffer.

Oh!  Here, `C-c C-c' creates `*Python*'.  I do not remember having seen
`*Python Output*'.  But I'll pay more attention to this for a while.
I also noticed that `C-c C-c' from an empty Python source file starts Python
without an error.  If the source is not empty, then the initial error shows.

> > P.S. - By the way, `C-c C-c' is an unfortunate binding, even if quick
> > to type.  In the source window, it starts the Python interpreter,
> > or at least, uses it.  In the interpreter window, it raises a signal
> > and kills it.

> Hm.  I hadn't thought of that.  I suppose that for me, this is like
> Python whitespace issue.  I've never had a problem with it.

I understand :-).  Yet, I think the problem is real.  As I wrote, I'm not
sure what to do, or suggest, about it.  `C-c C-c' is also used in Emacs for
sending a message once ready, or for closing some special editing buffers
when done.  These usages never created a problem to me, I guess that this
is probably because there is no possible confusion with `comint' issues.
Maybe, I'm not sure, that if the cursor was not jumping into the Python
interaction window after having done `C-c C-c' in the source window, things
would be more easy.  Surely, the command is convenient, because fast to type.

François Pinard

More information about the Python-list mailing list