Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Eduardo Ochs <eduardoochs <at> gmail.com>
Subject: Re: `url-retrieve-synchronously' is not synchronous enough
Newsgroups: gmane.emacs.devel
Date: Wednesday 14th November 2007 20:28:52 UTC (over 10 years ago)
> > `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/
  [email protected]
 
CD: 4ms