unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Downloading with Emacs
@ 2005-06-26  1:14 Lennart Borgman
  2005-06-26 12:17 ` Paul Pogonyshev
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2005-06-26  1:14 UTC (permalink / raw)


I have been testing a bit downloading things from the Internet with 
Emacs with the url package. However I am not able to understand how this 
should be done. Does anyone have examples of how to download binary files?

Another question: What about proxy servers with the url elisp package?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Downloading with Emacs
  2005-06-26  1:14 Downloading with Emacs Lennart Borgman
@ 2005-06-26 12:17 ` Paul Pogonyshev
  2005-06-26 14:32   ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Pogonyshev @ 2005-06-26 12:17 UTC (permalink / raw)


Lennart Borgman wrote:
> I have been testing a bit downloading things from the Internet with
> Emacs with the url package. However I am not able to understand how this
> should be done. Does anyone have examples of how to download binary files?

You can have a look at Wikipedia mode (https://gna.org/projects/wikipedia-el/).
It actually doesn't use binary files, but as far as I understand URL retrieves
things in binary (since I manage to use `decode-coding-string' with the
expected result.)  To finish file downloading, you just need to remove HTTP
headers and save the buffer in a file, I guess.

> Another question: What about proxy servers with the url elisp package?

See customization.  Proxy can be configured there.

Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Downloading with Emacs
  2005-06-26 12:17 ` Paul Pogonyshev
@ 2005-06-26 14:32   ` Lennart Borgman
  2005-06-26 17:43     ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2005-06-26 14:32 UTC (permalink / raw)
  Cc: emacs-devel

Paul Pogonyshev wrote:

>Lennart Borgman wrote:
>  
>
>>I have been testing a bit downloading things from the Internet with
>>Emacs with the url package. However I am not able to understand how this
>>should be done. Does anyone have examples of how to download binary files?
>>    
>>
>
>You can have a look at Wikipedia mode (https://gna.org/projects/wikipedia-el/).
>It actually doesn't use binary files, but as far as I understand URL retrieves
>things in binary (since I manage to use `decode-coding-string' with the
>expected result.)  To finish file downloading, you just need to remove HTTP
>headers and save the buffer in a file, I guess.
>
Thanks Paul, that helped even though I have been using just 
`url-retrieve' like you do in wikipedia.el for my tests. I was wondering 
if there were any "url-download functions".

I believe I will write a little package for downloading then, it seems 
useful.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Downloading with Emacs
  2005-06-26 14:32   ` Lennart Borgman
@ 2005-06-26 17:43     ` Lennart Borgman
       [not found]       ` <m1Dmgr6-0004REC@rattlesnake.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2005-06-26 17:43 UTC (permalink / raw)
  Cc: emacs-devel, Paul Pogonyshev

Lennart Borgman wrote:

> I believe I will write a little package for downloading then, it seems 
> useful.

I called the package url-dl.el. If anyone is interested you can find it 
on http://ourcomments.org/Emacs/DL/inst/.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Downloading with Emacs
       [not found]       ` <m1Dmgr6-0004REC@rattlesnake.com>
@ 2005-06-27  0:49         ` Lennart Borgman
  2005-06-28  4:17           ` Richard M. Stallman
  2005-06-28  5:52           ` Stefan Monnier
  2005-06-27  6:32         ` Downloading with Emacs - bug in url-http.el? Lennart Borgman
  1 sibling, 2 replies; 8+ messages in thread
From: Lennart Borgman @ 2005-06-27  0:49 UTC (permalink / raw)


Robert J. Chassell wrote:

>I just tried
>
>    (url-dl-download "http://purl.org/harder/dpans.html" 
>                     "/usr/local/src/" 
>                     nil 
>                     "Common_Lisp.texi")
>
>and received this error message:
>
>    error in process filter: progn: 
>    Opening output file: no such file or directory, 
>    /home/bob/emacs-21/http:/www.ifa.au.dk/~harder/dpans.html-h.txt
>
>I also tried the command replacing the nil argument with "" but the
>expression also failed.
>
>What should I do?
>  
>
Could not avoid testing. I believe it is a bug in the url.el -libraries. 
There is a callback telling a redirection was done. I recieve this 
instead of the one I should get when the download has finished.

Is there anyone who understands those libraries?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Downloading with Emacs - bug in url-http.el?
       [not found]       ` <m1Dmgr6-0004REC@rattlesnake.com>
  2005-06-27  0:49         ` Lennart Borgman
@ 2005-06-27  6:32         ` Lennart Borgman
  1 sibling, 0 replies; 8+ messages in thread
From: Lennart Borgman @ 2005-06-27  6:32 UTC (permalink / raw)


Robert J. Chassell wrote:

>I just tried
>
>    (url-dl-download "http://purl.org/harder/dpans.html" 
>                     "/usr/local/src/" 
>                     nil 
>                     "Common_Lisp.texi")
>
>and received this error message:
>
>    error in process filter: progn: 
>    Opening output file: no such file or directory, 
>    /home/bob/emacs-21/http:/www.ifa.au.dk/~harder/dpans.html-h.txt
>
>I also tried the command replacing the nil argument with "" but the
>expression also failed.
>  
>
I have tried to find the cause if this. It seems like the callback 
functions from url-retrieve does not work as it should. I get callbacks 
from redirections though I believe it is not documented that it should 
behave this way.

I have implemented a workaround. This workaround unfortunately means you 
can not have more than one download active (and it is not foolproof).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Downloading with Emacs
  2005-06-27  0:49         ` Lennart Borgman
@ 2005-06-28  4:17           ` Richard M. Stallman
  2005-06-28  5:52           ` Stefan Monnier
  1 sibling, 0 replies; 8+ messages in thread
From: Richard M. Stallman @ 2005-06-28  4:17 UTC (permalink / raw)
  Cc: bob, emacs-devel

    Could not avoid testing. I believe it is a bug in the url.el -libraries. 
    There is a callback telling a redirection was done. I recieve this 
    instead of the one I should get when the download has finished.

    Is there anyone who understands those libraries?

I don't think anyone here really understands them.
If you want to start learning about them, so you can maintain
them, that would be very useful.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Downloading with Emacs
  2005-06-27  0:49         ` Lennart Borgman
  2005-06-28  4:17           ` Richard M. Stallman
@ 2005-06-28  5:52           ` Stefan Monnier
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2005-06-28  5:52 UTC (permalink / raw)
  Cc: bob, emacs-devel

>> I just tried
>> 
>> (url-dl-download "http://purl.org/harder/dpans.html"
>> "/usr/local/src/"                     nil
>> "Common_Lisp.texi")
>> 
>> and received this error message:
>> 
>> error in process filter: progn:    Opening output file: no such file or
>> directory,
>> /home/bob/emacs-21/http:/www.ifa.au.dk/~harder/dpans.html-h.txt
>> 
>> I also tried the command replacing the nil argument with "" but the
>> expression also failed.
>> 
>> What should I do?
>> 
>> 
> Could not avoid testing. I believe it is a bug in the
> url.el -libraries. There is a callback telling a redirection was
> done. I recieve this instead of the one I should get when the download
> has finished.

I assume you use url-retrieve-synchronously or url-insert-file-contents.
For user-level use, I use url-handler-mode so that I can just do
C-x C-f http://foo/bar RET

Note that a "fix" in the area of http redirection was installed recently,
so maybe the bug you see was fixed, or maybe the fix introduced another bug
you're experiencing.

> Is there anyone who understands those libraries?

I don't understand URL, really, but I have worked on it a tiny bit.


        Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-06-28  5:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-26  1:14 Downloading with Emacs Lennart Borgman
2005-06-26 12:17 ` Paul Pogonyshev
2005-06-26 14:32   ` Lennart Borgman
2005-06-26 17:43     ` Lennart Borgman
     [not found]       ` <m1Dmgr6-0004REC@rattlesnake.com>
2005-06-27  0:49         ` Lennart Borgman
2005-06-28  4:17           ` Richard M. Stallman
2005-06-28  5:52           ` Stefan Monnier
2005-06-27  6:32         ` Downloading with Emacs - bug in url-http.el? Lennart Borgman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).