From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.devel Subject: Re: `url-retrieve-synchronously' is not synchronous enough Date: Wed, 14 Nov 2007 18:28:52 -0200 Message-ID: <87ve84a7wb.fsf@gmail.com> References: <87pryi7crj.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195072531 27297 80.91.229.12 (14 Nov 2007 20:35:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2007 20:35:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 14 21:35:36 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IsOxU-0004k1-2q for ged-emacs-devel@m.gmane.org; Wed, 14 Nov 2007 21:35:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IsOxH-00036y-CB for ged-emacs-devel@m.gmane.org; Wed, 14 Nov 2007 15:35:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IsOxC-00035C-SY for emacs-devel@gnu.org; Wed, 14 Nov 2007 15:35:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IsOx8-0002zt-HO for emacs-devel@gnu.org; Wed, 14 Nov 2007 15:35:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IsOx8-0002zl-9q for emacs-devel@gnu.org; Wed, 14 Nov 2007 15:35:14 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IsOx7-0004wT-QR for emacs-devel@gnu.org; Wed, 14 Nov 2007 15:35:14 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1IsOww-000767-MO for emacs-devel@gnu.org; Wed, 14 Nov 2007 20:35:02 +0000 Original-Received: from 189.25.156.72 ([189.25.156.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2007 20:35:02 +0000 Original-Received: from eduardoochs by 189.25.156.72 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Nov 2007 20:35:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 189.25.156.72 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:yHJNT6BwsTCCymtVupbsNtymn74= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:83205 Archived-At: > > `url-retrieve-synchronously' is not synchronous enough. > > When I execute this sexp, > > > > (progn (switch-to-buffer > > (url-retrieve-synchronously "http://127.0.0.1/")) > > (point)) > > > > the result is (point-max), but when I get the control back the > > point is at the first character of a buffer - as if some hook > > containing (goto-char (point-min)) ran after the (point) in the > > progn. > > Does this patch make it work? > > *** url.el 25 Jul 2007 11:49:25 -0400 1.27.2.1 > --- url.el 10 Nov 2007 19:58:50 -0500 > *************** > *** 240,246 **** > ;; XXX: The callback must always be called. Any > ;; exception is a bug that should be fixed, not worked > ;; around. > ! (setq retrieval-done t)) > ;; 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. > --- 240,248 ---- > ;; XXX: The callback must always be called. Any > ;; exception is a bug that should be fixed, not worked > ;; around. > ! (progn ;; Call delete-process so we run any sentinel now. > ! (delete-process proc) > ! (setq retrieval-done t))) > ;; 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. That fixed it! Thanks. :-) Eduardo Ochs http://angg.twu.net/ eduardoochs@gmail.com