changeset 54794:9978b1e48c24

(url-cookie-setup-save-timer): Avoid warnings.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 12 Apr 2004 04:03:06 +0000
parents 4051557a5374
children 31399f1df768
files lisp/url/url-cookie.el
diffstat 1 files changed, 42 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/url-cookie.el	Mon Apr 12 04:02:25 2004 +0000
+++ b/lisp/url/url-cookie.el	Mon Apr 12 04:03:06 2004 +0000
@@ -1,27 +1,30 @@
 ;;; url-cookie.el --- Netscape Cookie support
+
+;; Copyright (c) 1996 - 1999,2004  Free Software Foundation, Inc.
+;; Copyright (c) 1996 by William M. Perry <wmperry@cs.indiana.edu>
+
 ;; Keywords: comm, data, processes, hypermedia
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1996 by William M. Perry <wmperry@cs.indiana.edu>
-;;; Copyright (c) 1996 - 1999 Free Software Foundation, Inc.
-;;;
-;;; This file is part of GNU Emacs.
-;;;
-;;; GNU Emacs is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 2, or (at your option)
-;;; any later version.
-;;;
-;;; GNU Emacs is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;;; Boston, MA 02111-1307, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This file is part of GNU Emacs.
+;;
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+;;
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; Code:
 
 (require 'timezone)
 (require 'url-util)
@@ -151,7 +154,7 @@
       (kill-buffer (current-buffer))))))
 
 (defun url-cookie-store (name value &optional expires domain path secure)
-  "Stores a netscape-style cookie"
+  "Store a netscape-style cookie."
   (let* ((storage (if secure url-cookie-secure-storage url-cookie-storage))
 	 (tmp storage)
 	 (cur nil)
@@ -232,7 +235,7 @@
 
 ;;;###autoload
 (defun url-cookie-retrieve (host path &optional secure)
-  "Retrieves all the netscape-style cookies for a specified HOST and PATH"
+  "Retrieve all the netscape-style cookies for a specified HOST and PATH."
   (let ((storage (if secure
 		     (append url-cookie-secure-storage url-cookie-storage)
 		   url-cookie-storage))
@@ -290,7 +293,7 @@
    (mapconcat 'identity (list "com" "edu" "net" "org" "gov" "mil" "int")
 	      "\\|")
    "\\)$")
-  "A regular expression of top-level domains that only require two matching
+  "A regexp of top level domains that only require two matching
 '.'s in the domain name in order to set a cookie.")
 
 (defcustom url-cookie-trusted-urls nil
@@ -442,25 +445,23 @@
 (defun url-cookie-setup-save-timer ()
   "Reset the cookie saver timer."
   (interactive)
-  (cond
-   ((featurep 'itimer)
-    (ignore-errors (delete-itimer url-cookie-timer))
-    (setq url-cookie-timer nil)
-    (if url-cookie-save-interval
-	(setq url-cookie-timer
+  (ignore-errors
+    (cond ((fboundp 'cancel-timer) (cancel-timer url-cookie-timer))
+	  ((fboundp 'delete-itimer) (delete-itimer 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))))
-   ((fboundp 'run-at-time)
-    (ignore-errors (cancel-timer url-cookie-timer))
-    (setq url-cookie-timer nil)
-    (if url-cookie-save-interval
-	(setq url-cookie-timer
-	      (run-at-time url-cookie-save-interval
-			   url-cookie-save-interval
-			   'url-cookie-write-file))))
-   (t nil)))
+			    url-cookie-save-interval))))))
 
 (provide 'url-cookie)
 
-;;; arch-tag: 2568751b-6452-4398-aa2d-303edadb54d7
+;; arch-tag: 2568751b-6452-4398-aa2d-303edadb54d7
+;;; url-cookie.el ends here