From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: python-mode: make sure output is not eaten Date: Wed, 30 Aug 2006 18:10:33 -0400 Message-ID: References: <20060826215131.3906.SLAWOMIR.NOWACZYK.847@student.lu.se> <20060830212317.3A6F.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156975868 29780 80.91.229.2 (30 Aug 2006 22:11:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Aug 2006 22:11:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 31 00:11:06 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GIYGx-0004tP-2q for ged-emacs-devel@m.gmane.org; Thu, 31 Aug 2006 00:10:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIYGv-0000HN-FI for ged-emacs-devel@m.gmane.org; Wed, 30 Aug 2006 18:10:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GIYGj-0000H9-Os for emacs-devel@gnu.org; Wed, 30 Aug 2006 18:10:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GIYGg-0000FF-BG for emacs-devel@gnu.org; Wed, 30 Aug 2006 18:10:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIYGg-0000F4-3W for emacs-devel@gnu.org; Wed, 30 Aug 2006 18:10:42 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GIYQA-0005qV-9R for emacs-devel@gnu.org; Wed, 30 Aug 2006 18:20:30 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 973A02CEF9B; Wed, 30 Aug 2006 18:10:41 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 7ED903FE0; Wed, 30 Aug 2006 18:10:33 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 6B1754C6D25; Wed, 30 Aug 2006 18:10:33 -0400 (EDT) Original-To: Slawomir Nowaczyk In-Reply-To: <20060830212317.3A6F.SLAWOMIR.NOWACZYK.847@student.lu.se> (Slawomir Nowaczyk's message of "Wed, 30 Aug 2006 23:08:51 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59132 Archived-At: > #> > Agreed. But why is removing "_emacs_out ()" any more selective than > #> > removing ">>> _emacs_out ()"? > #> > #> We're talking about "^_emacs_out " vs "^\\(>>> \\)?_emacs_out": clearly > #> one of the two regexps describes a superset of the other. If you can > #> guarantee that it'll always match "^>>> _emacs_out ", then it's > #> a different question. > I do not think it is a problem... The following patch seems to work for me: But in what way is that better? > #> I see no reason why the two should be so linked. > python-send-command does very little beyond calling python-send-string. It did a lot more: it waited for the command to terminate, which involves monitoring the output, trying to recognize some special pattern in there. > #> > or python-send-string doesn't work for multiline strings, in which case > #> > the assert in python-send-command doesn't help at all (as you wrote, > #> > nothing can call it with multiline command anyway). > #> > #> In python-send-string, multiline strings work. In python-send-command > #> multiline strings were very likely to fail because we added "; print ...". > #> Hence the presence of an `assert' (assertions are of no use to the user, > #> their only meaning is for the programmer as a form of documentation that's > #> slightly better sync'd with the code than mere comments). > In other words, the only reason for the assert is that we have chosen to > add "; print" instead of sending two commands? Yup. > I am not sure what should be printed by python-send-string, but maybe > simple "print 1" would work best. If the string is simple/short, then it should be printed, as if the user had typed it in. > Yes, but -- IMHO -- this is only due to the bad design decision of > adding "; print" ;-) > #> Also adding the assert to python-send-command did not restrict the > #> user in any way, only the python.el hacker. > Right. Fine, this is probably not important enough to warrant further > discussion. Especially since python-send-command doesn't wait for the command to terminate any more, so it doesn't add any `print' any more, whether on the same line or on a separate one. Stefan