From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: more url-utils? Date: Tue, 17 May 2011 13:40:06 +0200 Organization: Programmerer Ingebrigtsen Message-ID: References: <8739kgqbui.fsf@gnu.org> <871uzy7b9o.fsf@lifelogs.com> <877h9q5ub7.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1305632442 7371 80.91.229.12 (17 May 2011 11:40:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 May 2011 11:40:42 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 17 13:40:38 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QMIdY-0005C3-Pe for ged-emacs-devel@m.gmane.org; Tue, 17 May 2011 13:40:28 +0200 Original-Received: from localhost ([::1]:37874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMIdY-0007k6-3G for ged-emacs-devel@m.gmane.org; Tue, 17 May 2011 07:40:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMIdU-0007jp-HW for emacs-devel@gnu.org; Tue, 17 May 2011 07:40:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMIdT-0003aF-9J for emacs-devel@gnu.org; Tue, 17 May 2011 07:40:24 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:42830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMIdS-0003a3-Ub for emacs-devel@gnu.org; Tue, 17 May 2011 07:40:23 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QMIdO-00053p-Ih for emacs-devel@gnu.org; Tue, 17 May 2011 13:40:18 +0200 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2011 13:40:18 +0200 Original-Received: from larsi by cm-84.215.51.58.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2011 13:40:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 38 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.51.58.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVyjqSNtq9GQ2bP5Mr6 /Oqmyrh+pauQIQ93AAACdElEQVQ4jV2TwXbqIBCGJ9GwDrVhTenVdb2E7nvAfSiO66AN7/8Id4bU 1nPRqJmPmX/4J8KhB4CSpRykVPCwXq4UL4uTxMoj2It5pphDGUsRs/gBm5NWuMQ4xFSKKjMIegMY 6GwX3RAlHodcLhSFCjR0bndBJOFLLiT2IG7P3jqLEalWzkL0oGAWAg4oEUlBSplJnV6UN4sWupOs S6nCC1gAytVAE4J1tH+NrxplNgbSGIKnYpIrSjUX6qpAS8AGJwfuqxSJRPQ9w1tkgJaXi9C2lEHg TAmF63ASKXEVuiqYYeC+uGM5U5k7OJEHee255CLVVVMlBl6BWMOF5yLVCr6Cjf1Cx871HLKOi8Fz cLFgrnNaibpW0AWnqNvL4KivqDL1d9UMNsEJAjFZPjl5mGXLx4CdU7BQiMJI4vw8tJwAt08Ng415 IJjJkW/QAAolahlU5NX0HdcZdtZWmxhk7EGwg0aTyWOwdrQjPT9lsb1A2VMOZZg/vJ9nEuUwXpLD SfTmIMG8MuBpVU7p5HL7QkCnFdwXDUWZRgKdMicC4wNBsyCD/WBHr39zfJwLspM3HMOHOf8S1zcJ FmOqtNmuwcQfxy7AptW1/NsK7JZb8+hh/3cFvm4Nt7F+Ww8vb21bwVB58bt6Z0HbqRnpx7Gp6rNf +7YAdpq3waUJag3vv1uGDbbm7NG6ywruLcO+h2P1xFbwTMhWsHEiBfYkIN1+hOhDSit4tfRoEeCN p9D78MX6cHgafXKSXPFVovNhy/lAB/cTGfa8lv5ZFBpS7I0e38f/AIgG8XCjjsNjEpjmaZYLpuTo D9E8At23usEpijG8N7/l/gEJ8+dGSM2tSgAAAABJRU5ErkJggg== Mail-Copies-To: never X-Now-Playing: Tuxedomoon's _You_: "Never Ending Story" User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:jRfcOC3rRHqyzthDci6Rvh7hOHg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139460 Archived-At: Stefan Monnier writes: > There are 3 parts. > - removal of header text. > - backward compatibility. > - providing header info in a non-textual format. Adding a new optional parameter `no-headers' (or something) to `url-retrieve' (and -synchronous) could do the trick, but the caller (who wants no headers) have to do some pretty deep inspection to find out whether this version of `url-retrieve' has that parameter or not. So how about a new function, with a signature something like this: (defun url-fetch (url &keywords callback cbargs silent)) The `callback' is optional, and if not provided, makes `url-fetch' be synchronous. (Too bad Emacs doesn't really have a culture for closures, because then we could get rid of cbargs, too. Being able to say stuff like (defun save-url (file) (url-fetch url :callback (lambda (status) (write-region (point-min) (point-max) file)))) would be kinda elegant, I think, instead of (defun save-url (file) (url-fetch url :callback (lambda (status file) (write-region (point-min) (point-max) file)) :cbargs (list file))) But that's a different discussion, perhaps. :-) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/