From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: python-mode: make sure output is not eaten
Date: Fri, 25 Aug 2006 18:53:41 -0400 [thread overview]
Message-ID: <jwvhd00ig7a.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20060825094503.4A84.SLAWOMIR.NOWACZYK.847@student.lu.se> (Slawomir Nowaczyk's message of "Fri, 25 Aug 2006 11:03:41 +0200")
> #> Yes, of course. BTW do you have any idea why the current code uses "\n\n"?
> Not, not really -- it looks to me like an attempt to fix some prompt
> problems which didn't quite work. Or it may be an attempt to have
> C-c C-s work for indented blocks, as Steven suggested.
I've installed a half-way solution which I believe keeps the old behavior
when needed.
> Not really, at least not in my testing... the problems I am seeing
> come from the fact that when eldoc sends commands, Python responds
> with line that looks like "_emacs_out reload(module)\n>>> " and the
> comint filter needs to remove the trailing prompt as well.
I've added python-preoutput-skip-next-prompt for that purpose. This way
such prompts should get removed unambiguously.
> OTOH, I like your solution of printing prompt only if there is some
> other output -- seems clean to me.
That's just what was there before (modulo the fact that it didn't catch all
situations).
> You have misspelled command as "comand" in
> (defun python-send-command (command)
Thanks. Fixed.
> Other than that, your patch looks OK to me. Please install, it's
> definitely an improvement.
I've installed a variation of it. Please fix it as you see fit.
> However, if you change the
> (string-match "\\`_emacs_out \\(.*\\)\n\\'" line)
> to
> (string-match "\\`\\(?:>>> \\)?_emacs_out \\(.*\\)\n\\'" line)
> then you do not need to do the trick of augmenting commands with ";
> print" statement: things work just fine if you do python-send-string
> followed by python-send-receive.
Silently interpreting/removing output from the process is always risky,
since the output may appear for other reasons than the ones we expected.
So I'd rather be extra careful to only recognize _emacs_out when I'm sure
it's really the internal thingy.
Stefan
next prev parent reply other threads:[~2006-08-25 22:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-21 20:16 python-mode: make sure output is not eaten Slawomir Nowaczyk
2006-08-22 6:10 ` Stefan Monnier
2006-08-22 18:26 ` Slawomir Nowaczyk
2006-08-23 4:04 ` Stefan Monnier
2006-08-25 0:18 ` Steven Huwig
2006-08-25 0:34 ` Steven Huwig
2006-08-25 1:29 ` Steven Huwig
2006-08-25 9:03 ` Slawomir Nowaczyk
2006-08-25 19:53 ` Ken Manheimer
2006-08-25 20:10 ` Stefan Monnier
2006-08-25 9:03 ` Slawomir Nowaczyk
2006-08-25 22:53 ` Stefan Monnier [this message]
2006-08-26 12:41 ` Slawomir Nowaczyk
2006-08-26 14:48 ` Stefan Monnier
2006-08-26 22:22 ` Slawomir Nowaczyk
2006-08-28 21:43 ` Stefan Monnier
2006-08-30 21:08 ` Slawomir Nowaczyk
2006-08-30 22:10 ` Stefan Monnier
2006-08-31 11:19 ` Slawomir Nowaczyk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvhd00ig7a.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.