From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/59570 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: url.el blocks Gnus+nnrss Date: Thu, 13 Jan 2005 09:35:15 -0500 Message-ID: <87pt09v2m1.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1105628180 7656 80.91.229.6 (13 Jan 2005 14:56:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Jan 2005 14:56:20 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 13 15:56:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cp6OO-0000nT-00 for ; Thu, 13 Jan 2005 15:56:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cp6a2-0006VC-Ug for ged-emacs-devel@m.gmane.org; Thu, 13 Jan 2005 10:08:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cp6YM-0005yl-At for emacs-devel@gnu.org; Thu, 13 Jan 2005 10:06:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cp6Uc-0005Dn-9o for emacs-devel@gnu.org; Thu, 13 Jan 2005 10:02:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cp6UZ-000565-8b for emacs-devel@gnu.org; Thu, 13 Jan 2005 10:02:31 -0500 Original-Received: from [209.226.175.34] (helo=tomts13-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cp64D-0005le-0Z for emacs-devel@gnu.org; Thu, 13 Jan 2005 09:35:17 -0500 Original-Received: from alfajor ([67.71.119.166]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050113143516.PSS1899.tomts13-srv.bellnexxia.net@alfajor>; Thu, 13 Jan 2005 09:35:16 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id B87DD2FD05; Thu, 13 Jan 2005 09:35:15 -0500 (EST) Original-To: Katsumi Yamaoka In-Reply-To: (Katsumi Yamaoka's message of "Thu, 13 Jan 2005 21:16:19 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) 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: main.gmane.org gmane.emacs.devel:32195 gmane.emacs.gnus.general:59570 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:59570 > Several people reported that Gnus hangs if they subscribe to > nnrss groups. nnrss is a back end which uses the url ELisp > package by default and enables to read rss feeds as if they were > newsgroups. I've myself been using the patch below for a while now (it basically does the same as yours, except it hoists the get-buffer-process outside the loop and it removes the timeout since it shouldn't be needed now that Emacs knows what we're waiting for). I've just installed it. Stefan --- orig/lisp/url/url.el +++ mod/lisp/url/url.el @@ -1,6 +1,7 @@ ;;; url.el --- Uniform Resource Locator retrieval tool -;; Copyright (c) 1996,1997,1998,1999,2001,2004 Free Software Foundation, Inc. +;; Copyright (c) 1996, 1997, 1998, 1999, 2001, 2004, 2005 +;; Free Software Foundation, Inc. ;; Author: Bill Perry ;; Keywords: comm, data, processes, hypermedia @@ -169,26 +169,24 @@ (url-debug 'retrieval "Synchronous fetching done (%S)" (current-buffer)) (setq retrieval-done t asynch-buffer (current-buffer))))) - (if (not asynch-buffer) + (let ((proc (and asynch-buffer (get-buffer-process asynch-buffer)))) + (if (null proc) ;; We do not need to do anything, it was a mailto or something ;; similar that takes processing completely outside of the URL ;; package. nil (while (not retrieval-done) (url-debug 'retrieval "Spinning in url-retrieve-synchronously: %S (%S)" retrieval-done asynch-buffer) - ;; Quoth Stef: - ;; It turns out that the problem seems to be that the (sit-for - ;; 0.1) below doesn't actually process the data: instead it - ;; returns immediately because there is keyboard input - ;; waiting, so we end up spinning endlessly waiting for the - ;; process to finish while not letting it finish. - - ;; However, raman claims that it blocks Emacs with Emacspeak - ;; for unexplained reasons. Put back for his benefit until - ;; someone can understand it. - ;; (sleep-for 0.1) - (sit-for 0.1)) + ;; We used to use `sit-for' here, but in some cases it wouldn't + ;; work because apparently pending keyboard input would always + ;; interrupt it before it got a chance to handle process input. + ;; `sleep-for' was tried but it lead to other forms of + ;; hanging. --Stef + (unless (accept-process-output proc) + ;; accept-process-output returned nil, maybe because the process + ;; exited (and may have been replaced with another). + (setq proc (get-buffer-process asynch-buffer))))) asynch-buffer))) (defun url-mm-callback (&rest ignored)