From: Julien Danjou Date: Sun, 19 Sep 2010 18:48:11 +0000 (-0700) Subject: * lisp/url/url-cache.el (url-fetch-from-cache): New function. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~47^2~76 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=50e4f0bf347c8e977d9c1564f9bd9a8af3dcf140;p=emacs.git * lisp/url/url-cache.el (url-fetch-from-cache): New function. --- diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index f8987cb64d9..9bc9d3110f8 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,7 @@ +2010-09-19 Julien Danjou + + * url-cache.el (url-fetch-from-cache): New function. + 2010-09-18 Julien Danjou * url-vars.el (url-cache-expired): Remove unused variable. diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el index 3a6f00db306..28d0af761ea 100644 --- a/lisp/url/url-cache.el +++ b/lisp/url/url-cache.el @@ -68,6 +68,12 @@ FILE can be created or overwritten." (let ((coding-system-for-write 'binary)) (write-region (point-min) (point-max) fname nil 5)))))) +(defun url-fetch-from-cache (url) + "Fetch URL from cache and return a buffer with the content." + (with-current-buffer (generate-new-buffer " *temp*") + (url-cache-extract (url-cache-create-filename url)) + (current-buffer))) + ;;;###autoload (defun url-is-cached (url) "Return non-nil if the URL is cached."