From: Glenn Morris Date: Thu, 23 Sep 2010 05:59:20 +0000 (-0700) Subject: * url-cache.el (url-cache-expired): Don't autoload. Tweak previous change. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~47^2~42^2~89 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=48ff1664e2b76bea1f9c1fad8fb73e1c0d5ce849;p=emacs.git * url-cache.el (url-cache-expired): Don't autoload. Tweak previous change. --- diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index f19c639e930..531548cd0be 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2010-09-23 Glenn Morris + + * url-cache.el (url-cache-expired): Don't autoload. + Tweak previous change. + 2010-09-23 Julien Danjou * url-cache.el (url-cache-expire-time): New option. diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el index 834ad7c2530..22095eb631d 100644 --- a/lisp/url/url-cache.el +++ b/lisp/url/url-cache.el @@ -191,20 +191,19 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise." (erase-buffer) (insert-file-contents-literally fnam)) -;;;###autoload (defun url-cache-expired (url &optional expire-time) - "Return t if a cached URL is more than EXPIRE-TIME old. -If EXPIRE-TIME is not set, `url-cache-expire-time' is used instead." - (cond (url-standalone-mode - (not (file-exists-p (url-cache-create-filename url)))) - (t (let ((cache-time (url-is-cached url))) - (if cache-time - (time-less-p - (time-add - (url-is-cached url) - (seconds-to-time (or expire-time url-cache-expire-time))) - (current-time)) - t))))) + "Return non-nil if a cached URL is older than EXPIRE-TIME seconds. +The default value of EXPIRE-TIME is `url-cache-expire-time'. +If `url-standalone-mode' is non-nil, cached items never expire." + (if url-standalone-mode + (not (file-exists-p (url-cache-create-filename url))) + (let ((cache-time (url-is-cached url))) + (and cache-time + (time-less-p + (time-add + cache-time + (seconds-to-time (or expire-time url-cache-expire-time))) + (current-time)))))) (provide 'url-cache)