unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David Engster <deng@randomsample.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Asynchronously downloading a file
Date: Fri, 02 Jul 2010 09:41:37 +0200	[thread overview]
Message-ID: <87k4pe72ku.fsf@arcor.de> (raw)
In-Reply-To: AANLkTiko3vvIJacr2lGWRkis2Sv48Qk_IDDL4foVT1SK@mail.gmail.com

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




  parent reply	other threads:[~2010-07-02  7:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 21:43 Asynchronously downloading a file Deniz Dogan
2010-07-02  6:33 ` Qiang Guo
2010-07-02  9:04   ` Deniz Dogan
2010-07-02  9:06   ` Daniel Pittman
2010-07-02  9:22     ` Deniz Dogan
2010-07-02  9:46       ` Daniel Pittman
2010-07-02 10:11         ` Deniz Dogan
2010-07-02 10:16           ` Lennart Borgman
2010-07-02  7:41 ` David Engster [this message]
2010-07-02  9:23 ` Alberto Luaces
     [not found] ` <mailman.5.1278062489.22038.help-gnu-emacs@gnu.org>
2010-07-02  9:24   ` Andreas Politz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4pe72ku.fsf@arcor.de \
    --to=deng@randomsample.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).