From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Einstein Newsgroups: gmane.emacs.bugs Subject: Python mode hang. Date: Thu, 13 Dec 2007 08:39:26 -0800 (PST) Organization: http://groups.google.com Message-ID: <3dd19e5c-4293-4b75-b02d-dbfc431544b5@s8g2000prg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197652167 16733 80.91.229.12 (14 Dec 2007 17:09:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Dec 2007 17:09:27 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 14 18:09:37 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J3E2a-0004zE-NL for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Dec 2007 18:09:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J3E2H-0005wv-VM for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Dec 2007 12:09:18 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s8g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 44 Original-NNTP-Posting-Host: 70.91.132.221 Original-X-Trace: posting.google.com 1197563967 14649 127.0.0.1 (13 Dec 2007 16:39:27 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 13 Dec 2007 16:39:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s8g2000prg.googlegroups.com; posting-host=70.91.132.221; posting-account=gyEdXQkAAABZLCLsL2VPE-bIGpqcZ7Gj User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.bug:44087 X-Mailman-Approved-At: Fri, 14 Dec 2007 12:06:53 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17168 Archived-At: My emacs 22 froze completely on windows XP when attempting to start and inferior python process. This there are a few fixes for this symptom posted here on gnu.bug.emacs, and it apears that the symptom is also fixed in the latest version in subversion. However, I believe, that the underlying problem still exists, and that emacs is relying on the python sub process being very well behaved. My knowledge of both emacs lisp and python are not great, but I suspect that the function python-send-receive in python.el is suspect. (defun python-send-receive (string) "Send STRING to inferior Python (if any) and return result. The result is what follows `_emacs_out' in the output." (python-send-string string) (let ((proc (python-proc))) (with-current-buffer (process-buffer proc) (set (make-local-variable 'python-preoutput-result) nil) (while (progn (accept-process-output proc 5) (null python-preoutput-result))) (prog1 python-preoutput-result (kill-local-variable 'python-preoutput-result))))) The problem here is that if the python subprocess never returns, or never outputs text containing '_emacs_out', emacs will be stuck in the loop (while (progn (accept-process-output proc 5) (null python-preoutput-result))) Here python-preoutput-result is updated by python-preoutput-filter to contain the text after '_emacs_out' and before the next prompt. My understanding of emacs lisp says that this loop should hang emacs if the python process never sets python-preoutput-result. I doubt that this is the intended behavior. None of the other inferior modes seem to be designed this way, but I have not done an exhaustive search. Unfortunately, I have no idea of the correct way of approaching this problem. Thank You, Deinst