1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-01 11:14:55 +00:00

* lisp/url/url-cache.el (url-fetch-from-cache): New function.

This commit is contained in:
Julien Danjou 2010-09-19 11:48:11 -07:00 committed by Glenn Morris
parent 2bc0110432
commit 50e4f0bf34
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2010-09-19 Julien Danjou <julien@danjou.info>
* url-cache.el (url-fetch-from-cache): New function.
2010-09-18 Julien Danjou <julien@danjou.info>
* url-vars.el (url-cache-expired): Remove unused variable.

View File

@ -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."