changeset 67368:5c87802be570

(url-cookie-save-interval): Simplify. (url-cookie-setup-save-timer): Simplify.
author Richard M. Stallman <rms@gnu.org>
date Thu, 08 Dec 2005 00:01:35 +0000
parents 80952520899f
children ccc8ef2b4e14
files lisp/url/url-cookie.el
diffstat 1 files changed, 8 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/url-cookie.el	Thu Dec 08 00:00:20 2005 +0000
+++ b/lisp/url/url-cookie.el	Thu Dec 08 00:01:35 2005 +0000
@@ -449,11 +449,10 @@
 Default is 1 hour.  Note that if you change this variable outside of
 the `customize' interface after `url-do-setup' has been run, you need
 to run the `url-cookie-setup-save-timer' function manually."
-  :set (function (lambda (var val)
-		   (set-default var val)
-		   (and (featurep 'url)
-			(fboundp 'url-cookie-setup-save-timer)
-			(url-cookie-setup-save-timer))))
+  :set #'(lambda (var val)
+	   (set-default var val)
+	   (if (bound-and-true-p url-setup-done)
+	       (url-cookie-setup-save-timer)))
   :type 'integer
   :group 'url)
 
@@ -461,21 +460,12 @@
 (defun url-cookie-setup-save-timer ()
   "Reset the cookie saver timer."
   (interactive)
-  (ignore-errors
-    (cond ((fboundp 'cancel-timer) (cancel-timer url-cookie-timer))
-	  ((fboundp 'delete-itimer) (delete-itimer url-cookie-timer))))
+  (ignore-errors (cancel-timer url-cookie-timer))
   (setq url-cookie-timer nil)
   (if url-cookie-save-interval
-      (setq url-cookie-timer
-	    (cond
-	     ((fboundp 'run-at-time)
-	      (run-at-time url-cookie-save-interval
-			   url-cookie-save-interval
-			   'url-cookie-write-file))
-	     ((fboundp 'start-itimer)
-	      (start-itimer "url-cookie-saver" 'url-cookie-write-file
-			    url-cookie-save-interval
-			    url-cookie-save-interval))))))
+      (setq url-cookie-timer (run-at-time url-cookie-save-interval
+					  url-cookie-save-interval
+					  #'url-cookie-write-file))))
 
 (provide 'url-cookie)