From 50e4f0bf347c8e977d9c1564f9bd9a8af3dcf140 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 19 Sep 2010 11:48:11 -0700 Subject: [PATCH] * lisp/url/url-cache.el (url-fetch-from-cache): New function. --- lisp/url/ChangeLog | 4 ++++ lisp/url/url-cache.el | 6 ++++++ 2 files changed, 10 insertions(+) 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." -- 2.39.2