help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronously downloading a file


From: David Engster
Subject: Re: Asynchronously downloading a file
Date: Fri, 02 Jul 2010 09:41:37 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Deniz Dogan writes:
> I'm currently using find-file to view images fetched over HTTP.
> However, sometimes the server hosting the image is kind of slow and
> thus Emacs just hangs waiting for the image to fully download before I
> can view it.
>
> Is there any existing Emacs functionality which asynchronously gets a
> file from any of the protocols that e.g. find-file (tramp?) supports
> which lets me provide a callback function?

I don't think there's something in Emacs proper which does that right
away.

At least for http, you could use emacs-w3m, which support asynchronous
retrieval of URLs:

(w3m-retrieve URL &optional NO-UNCOMPRESS NO-CACHE POST-DATA REFERER
HANDLER)

Retrieve web contents pointed to by URL.
It will put the retrieved contents into the current buffer.
[...]
If HANDLER is a function, this function will come to an end in no time.
In this case, contents will be retrieved by the asynchronous process
after a while.  And after finishing retrieving contents successfully,
HANDLER will be called on the buffer where this function starts.
[...]

Regards,
David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]