emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101550: * url-cache.el (url-cache-ex


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101550: * url-cache.el (url-cache-expired): Don't autoload. Tweak previous change.
Date: Wed, 22 Sep 2010 22:59:20 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101550
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2010-09-22 22:59:20 -0700
message:
  * url-cache.el (url-cache-expired): Don't autoload.  Tweak previous change.
modified:
  lisp/url/ChangeLog
  lisp/url/url-cache.el
=== modified file 'lisp/url/ChangeLog'
--- a/lisp/url/ChangeLog        2010-09-23 05:56:17 +0000
+++ b/lisp/url/ChangeLog        2010-09-23 05:59:20 +0000
@@ -1,3 +1,8 @@
+2010-09-23  Glenn Morris  <address@hidden>
+
+       * url-cache.el (url-cache-expired): Don't autoload.
+       Tweak previous change.
+
 2010-09-23  Julien Danjou  <address@hidden>
 
        * url-cache.el (url-cache-expire-time): New option.

=== modified file 'lisp/url/url-cache.el'
--- a/lisp/url/url-cache.el     2010-09-23 05:56:17 +0000
+++ b/lisp/url/url-cache.el     2010-09-23 05:59:20 +0000
@@ -191,20 +191,19 @@
   (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)
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]