From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: more url-utils? Date: Sun, 15 May 2011 09:34:48 -0400 Message-ID: <87fwogaxzb.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1305587249 21325 80.91.229.12 (16 May 2011 23:07:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 May 2011 23:07:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 17 01:07:25 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 1QM6sm-0000cG-TW for ged-emacs-devel@m.gmane.org; Tue, 17 May 2011 01:07:25 +0200 Original-Received: from localhost ([::1]:49810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM6sl-0001u9-Kx for ged-emacs-devel@m.gmane.org; Mon, 16 May 2011 19:07:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM6sf-0001tq-DF for emacs-devel@gnu.org; Mon, 16 May 2011 19:07:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QM6sb-0003hi-El for emacs-devel@gnu.org; Mon, 16 May 2011 19:07:17 -0400 Original-Received: from [12.21.149.2] (port=37580 helo=shcommander.singledigits.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM6sb-0003hV-Bz for emacs-devel@gnu.org; Mon, 16 May 2011 19:07:13 -0400 Original-Received: from [10.71.1.172] (helo=furball) by shcommander.singledigits.com with esmtp (Exim 4.70) (envelope-from ) id 1QLbT6-00017W-K8; Sun, 15 May 2011 09:34:49 -0400 Original-Received: by furball (Postfix, from userid 1000) id 424E31604A8; Sun, 15 May 2011 09:34:48 -0400 (EDT) In-Reply-To: (joakim@verona.se's message of "Sat, 14 May 2011 12:32:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 12.21.149.2 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:139455 Archived-At: joakim@verona.se writes: > Would the defun below be suitable to include in url-util? > You nearly always want to work with the data part of the document. > The code snippet below occurs a lot in different packages. > > A wrapper that downloads a file(like curl or wget) would be nice also. > > (defun org-feed-skip-http-headers (buffer) > "Remove HTTP headers from BUFFER, and return it. > Assumes headers are indeed present!" > (with-current-buffer buffer > (widen) > (goto-char (point-min)) > (search-forward "\n\n") > (delete-region (point-min) (point)) > buffer)) Good idea, though maybe the wrapper function should incorporate url-http-parse-response too (see the package-handle-response function in package.el). Please feel free to propose a patch.