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 15:18:53 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87liy64cwi.fsf@lifelogs.com> References: <8739kgqbui.fsf@gnu.org> <871uzy7b9o.fsf@lifelogs.com> <877h9q5ub7.fsf@lifelogs.com> <87y6264f29.fsf@lifelogs.com> <87k4dqtoc4.fsf@keller.adm.naquadah.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1305577157 31433 80.91.229.12 (16 May 2011 20:19:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 May 2011 20:19:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 16 22:19:13 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 1QM4G0-00025S-Rl for ged-emacs-devel@m.gmane.org; Mon, 16 May 2011 22:19:13 +0200 Original-Received: from localhost ([::1]:50280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM4G0-0003as-Bp for ged-emacs-devel@m.gmane.org; Mon, 16 May 2011 16:19:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM4Fx-0003ah-OH for emacs-devel@gnu.org; Mon, 16 May 2011 16:19:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QM4Fw-0007n8-Ko for emacs-devel@gnu.org; Mon, 16 May 2011 16:19:09 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:54692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM4Fw-0007mt-8l for emacs-devel@gnu.org; Mon, 16 May 2011 16:19:08 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QM4Fu-00022X-KQ for emacs-devel@gnu.org; Mon, 16 May 2011 22:19:06 +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 22:19:06 +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 22:19:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 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:zb12+6U2sU4LfjJ+jgbA0en5I/4= 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:139443 Archived-At: On Mon, 16 May 2011 21:52:43 +0200 Julien Danjou wrote: JD> On Mon, May 16 2011, Ted Zlatanov wrote: >> 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. JD> That can be true. When you fetch an URL, you want to know if the fetch JD> result is a 200 OK or a 404 Not Found. That's the absolute minimum thing JD> you want to do if you plan to write correct code. JD> So just dropping the header sounds like a very bad programming practice, JD> and not something I'd encourage. You won't get a HTTP status (or any headers, sometimes) from a non-HTTP URL. So the status is only useful in some cases and relying on it makes the code inflexible, depending on the transport protocol's artifacts. JD> I wrote code with url.el. And what I always did is (search-forward JD> "\n\n") to move point between headers and content, and then parse the JD> headers to at least check the return code (expecting 200 usually). That's a symptom of a bad API that tied you to HTTP headers and what I was trying to eliminate. On Mon, 16 May 2011 16:53:37 -0300 Stefan Monnier wrote: >>>> After looking at many examples in Emacs, I can't find or think of any >>>> need for the headers *as text* in the code I've seen. I would: SM> That sounds right. >> ...so can I go ahead with my proposal or would you rather be >> conservative and keep the old behavior, making API users turn off >> headers explicitly? SM> There are 3 parts. SM> - removal of header text. SM> - backward compatibility. SM> - providing header info in a non-textual format. Ah, OK. So my proposal does not fit because you want backwards compatibility. I was hoping to eliminate the bad API altogether but this is at least a step forward. Let me know if you want me to implement any parts of this. Thanks Ted