From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: more url-utils? Date: Mon, 16 May 2011 14:55:02 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87pqni4e09.fsf@lifelogs.com> References: <8739kgqbui.fsf@gnu.org> <871uzy7b9o.fsf@lifelogs.com> <877h9q5ub7.fsf@lifelogs.com> <87y6264f29.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1305575732 22453 80.91.229.12 (16 May 2011 19:55:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 May 2011 19:55:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 16 21:55:28 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 1QM3sy-0005Uf-2K for ged-emacs-devel@m.gmane.org; Mon, 16 May 2011 21:55:24 +0200 Original-Received: from localhost ([::1]:36654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM3sx-0004dE-Ky for ged-emacs-devel@m.gmane.org; Mon, 16 May 2011 15:55:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM3su-0004cv-Cn for emacs-devel@gnu.org; Mon, 16 May 2011 15:55:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QM3st-0003tX-FL for emacs-devel@gnu.org; Mon, 16 May 2011 15:55:20 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:43738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM3st-0003tN-3I for emacs-devel@gnu.org; Mon, 16 May 2011 15:55:19 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QM3sq-0005PG-V3 for emacs-devel@gnu.org; Mon, 16 May 2011 21:55:16 +0200 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 May 2011 21:55:16 +0200 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 May 2011 21:55:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:lzih2jZc11OnzgZJ2xQzzdx5yBc= 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:139442 Archived-At: On Mon, 16 May 2011 21:33:55 +0200 Lennart Borgman wrote: LB> 2011/5/16 Ted Zlatanov : >> On Mon, 16 May 2011 21:22:02 +0200 Lennart Borgman wrote: LB> I would go for Julien's suggestion with a function LB> `url-remove-headers' which also parsed the headers and returned a LB> alist of the headers. >> >> I'm trying to avoid that approach: we just established the headers are >> almost never necessary in the buffer.  So we should not ask the API >> users to do anything extra to remove them. LB> It can be combined with your approach with an extra argument. The existence of `url-remove-headers' is a symptom of a bad API and should be unnecessary, together with extra arguments. The usage would be (remember, `url-retrieve-synchronously' is obsoleted in my proposal in favor or `url-retrieve2-synchronously'): (if (setq buf (url-retrieve2-synchronously url)) (with-current-buffer buf (message "Header x is %s" (assq 'x url-headers-alist)) (message "Header y is %s" (assoc "y" url-headers-alist)) (message "The headers as a string are %s" url-headers-as-string) (message "data is %s" (buffer-string)) ...) (...handle errors here...)) which is, I think, how everyone wants to use this function based on browsing a whole bunch of code. So inserting the headers would be just (insert url-headers-as-string) and too trivial to provide as a function. Ted