From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Newsgroups: gmane.emacs.bugs Subject: bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited Date: Sun, 15 Jun 2014 14:12:32 -0300 Message-ID: <87mwdef667.fsf@gnu.org> References: <535F96ED.4070205@gmail.com> <43k3a399xr.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1402853182 29180 80.91.229.3 (15 Jun 2014 17:26:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Jun 2014 17:26:22 +0000 (UTC) To: Glenn Morris , 17370@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 15 19:26:13 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WwEC0-0007DJ-Lz for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jun 2014 19:26:08 +0200 Original-Received: from localhost ([::1]:39464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwEC0-0003FI-9m for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jun 2014 13:26:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwEBv-0003FC-Kj for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2014 13:26:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwEBu-0002Fl-MY for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2014 13:26:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwEBu-0002Fe-It for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2014 13:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WwEBu-000402-9S for bug-gnu-emacs@gnu.org; Sun, 15 Jun 2014 13:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Jun 2014 17:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17370 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17370-submit@debbugs.gnu.org id=B17370.140285315415360 (code B ref 17370); Sun, 15 Jun 2014 17:26:02 +0000 Original-Received: (at 17370) by debbugs.gnu.org; 15 Jun 2014 17:25:54 +0000 Original-Received: from localhost ([127.0.0.1]:48476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WwEBl-0003zg-O0 for submit@debbugs.gnu.org; Sun, 15 Jun 2014 13:25:54 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:35927 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WwEBj-0003zX-4K for 17370@debbugs.gnu.org; Sun, 15 Jun 2014 13:25:51 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WwEBi-0004bK-J6 for 17370@debbugs.gnu.org; Sun, 15 Jun 2014 13:25:50 -0400 Resent-Message-ID: <21405.55070.466963.393903@gnu.org> Resent-Date: Sun, 15 Jun 2014 13:25:50 -0400 Resent-From: Glenn Morris Resent-To: 17370@debbugs.gnu.org In-Reply-To: <43k3a399xr.fsf@fencepost.gnu.org> (Glenn Morris's message of "Fri, 02 May 2014 16:56:16 -0400") X-Bogosity: no, spamicity=0.035526, v1.2.1 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90404 Archived-At: Glenn Morris writes: > Glenn Morris wrote: > >> (python-shell-internal-send-string "import sys;print ('\\n'.join(sys.pat= h))") >> >> It is this that hangs (in python-shell-send-string-no-output AFAICS). >> It also hangs in Emacs 24.3. >> >> emacs -Q -l python > > It seems that for me the hang is because I have customized my python > prompt (sys.ps1 =3D 'py> ' in ~/.pythonrc.py). > > I have to set python-shell-prompt-regexp to match to avoid a hang as > python.el thinks it needs to keep waiting for process output. > > Can python.el be made more robust in this regard? > > Otherwise there needs to be a big fat warning attached to > python-shell-prompt-regexp. > > > > We definitely can do better. One way would be to set the prompt regexp dynamically using the values of sys.ps1 and sys.ps2. But then we also need to be careful as those values for ipython are a lie: $ ipython Python 2.7.6 (default, Mar 22 2014, 22:59:56) Type "copyright", "credits" or "license" for more information. IPython 1.2.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: import sys In [2]: sys.ps1 Out[2]: 'In : ' Perhaps the best way to go is a mixture of the current way and dinamically expanding `python-shell-prompt-regexp` with sys.ps1 and sys.ps2. I'll give it a try in the next few weeks and follow up once I see how it goes. Fabi=C3=A1n