unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se>
Subject: Re: python-mode: make sure output is not eaten
Date: Fri, 25 Aug 2006 11:03:41 +0200	[thread overview]
Message-ID: <20060825100525.4A98.SLAWOMIR.NOWACZYK.847@student.lu.se> (raw)
In-Reply-To: <E37BF3DF-DA04-415D-B764-E5B75E7D84EB@acm.org>

On Thu, 24 Aug 2006 20:18:07 -0400
Steven Huwig <steven.huwig@gmail.com> wrote:

#> On Aug 23, 2006, at 12:04 AM, Stefan Monnier wrote:
#> >
#> > Yes, of course.  BTW do you have any idea why the current code uses  
#> > "\n\n"?
#> 
#> Might it be because the Python interactive interpreter needs the extra
#> newline due to significant whitespace?  E.g.
#> 
#>  >>> for i in range(1,5):
#> ...     print i,
#> ...
#> 1 2 3 4
#> 
#> a DEDENT token is created by the unindented second newline, closing
#> the block.  A single newline cannot do that as it is also the
#> statement terminator.
#> 
#> Probably it compensates for indented text without a trailing newline.
#> It doesn't look like python-mode itself has any situations where this
#> matters, but it is possible -- but unlikely -- for user input to be
#> affected.
#> 
#> If you do the following in python-mode with both versions:
#> 
#> C-c C-s for i in range(1, 5): C-q C-j
#> <tab> print i, <return>
#> 
#> you will see the difference in behavior.

OK, you are right... In my testing I only made sure that ending code
with indented block works fine with commands like python-send-buffer and
python-send-region, I haven't tested with bare python-send-string. Yes,
double "\n" might be an attempt to get that working.

#> To explain my post a little more, I think the new code is the right
#> thing. If someone is astute enough to type in multi-line Python
#> commands at an Emacs interactive prompt, then they will likely be
#> astute enough to realize that they need to add an extra newline.
#> 
#> Plus I don't think the usage pattern is typical in the first place;
#> there is a comint buffer for such interaction.

I agree.

Besides, if anything, TRT would be to allow people start an indented
block with C-c C-s and then *continue* it in comint buffer... but it is
neither easy nor important enough to worry about it right now, IMHO.

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( slawomir.nowaczyk.847@student.lu.se )

Write your questions down on the back of $20 dollar bill and send them to me.

  parent reply	other threads:[~2006-08-25  9:03 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060825100525.4A98.SLAWOMIR.NOWACZYK.847@student.lu.se \
    --to=slawomir.nowaczyk.847@student.lu.se \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).