diff options
| author | Stefan Monnier | 2004-04-12 04:03:06 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-04-12 04:03:06 +0000 |
| commit | 10c3c720ca922eed55746a29d3c5f1c5ef45f6b0 (patch) | |
| tree | cab590affef883e110a2d7a0e90a6391d624c1d8 | |
| parent | 55d6ea46f80a1858487fa8ba54c7619d17e4e483 (diff) | |
| download | emacs-10c3c720ca922eed55746a29d3c5f1c5ef45f6b0.tar.gz emacs-10c3c720ca922eed55746a29d3c5f1c5ef45f6b0.zip | |
(url-cookie-setup-save-timer): Avoid warnings.
| -rw-r--r-- | lisp/url/url-cookie.el | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 2b359f8554b..2a282c7d00a 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el | |||
| @@ -1,27 +1,30 @@ | |||
| 1 | ;;; url-cookie.el --- Netscape Cookie support | 1 | ;;; url-cookie.el --- Netscape Cookie support |
| 2 | |||
| 3 | ;; Copyright (c) 1996 - 1999,2004 Free Software Foundation, Inc. | ||
| 4 | ;; Copyright (c) 1996 by William M. Perry <wmperry@cs.indiana.edu> | ||
| 5 | |||
| 2 | ;; Keywords: comm, data, processes, hypermedia | 6 | ;; Keywords: comm, data, processes, hypermedia |
| 3 | 7 | ||
| 4 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 8 | ;; This file is part of GNU Emacs. |
| 5 | ;;; Copyright (c) 1996 by William M. Perry <wmperry@cs.indiana.edu> | 9 | ;; |
| 6 | ;;; Copyright (c) 1996 - 1999 Free Software Foundation, Inc. | 10 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| 7 | ;;; | 11 | ;; it under the terms of the GNU General Public License as published by |
| 8 | ;;; This file is part of GNU Emacs. | 12 | ;; the Free Software Foundation; either version 2, or (at your option) |
| 9 | ;;; | 13 | ;; any later version. |
| 10 | ;;; GNU Emacs is free software; you can redistribute it and/or modify | 14 | ;; |
| 11 | ;;; it under the terms of the GNU General Public License as published by | 15 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 12 | ;;; the Free Software Foundation; either version 2, or (at your option) | 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; any later version. | 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; | 18 | ;; GNU General Public License for more details. |
| 15 | ;;; GNU Emacs is distributed in the hope that it will be useful, | 19 | ;; |
| 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 20 | ;; You should have received a copy of the GNU General Public License |
| 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to the |
| 18 | ;;; GNU General Public License for more details. | 22 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | ;;; | 23 | ;; Boston, MA 02111-1307, USA. |
| 20 | ;;; You should have received a copy of the GNU General Public License | 24 | |
| 21 | ;;; along with GNU Emacs; see the file COPYING. If not, write to the | 25 | ;;; Commentary: |
| 22 | ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 26 | |
| 23 | ;;; Boston, MA 02111-1307, USA. | 27 | ;;; Code: |
| 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 25 | 28 | ||
| 26 | (require 'timezone) | 29 | (require 'timezone) |
| 27 | (require 'url-util) | 30 | (require 'url-util) |
| @@ -151,7 +154,7 @@ telling Microsoft that.") | |||
| 151 | (kill-buffer (current-buffer)))))) | 154 | (kill-buffer (current-buffer)))))) |
| 152 | 155 | ||
| 153 | (defun url-cookie-store (name value &optional expires domain path secure) | 156 | (defun url-cookie-store (name value &optional expires domain path secure) |
| 154 | "Stores a netscape-style cookie" | 157 | "Store a netscape-style cookie." |
| 155 | (let* ((storage (if secure url-cookie-secure-storage url-cookie-storage)) | 158 | (let* ((storage (if secure url-cookie-secure-storage url-cookie-storage)) |
| 156 | (tmp storage) | 159 | (tmp storage) |
| 157 | (cur nil) | 160 | (cur nil) |
| @@ -232,7 +235,7 @@ telling Microsoft that.") | |||
| 232 | 235 | ||
| 233 | ;;;###autoload | 236 | ;;;###autoload |
| 234 | (defun url-cookie-retrieve (host path &optional secure) | 237 | (defun url-cookie-retrieve (host path &optional secure) |
| 235 | "Retrieves all the netscape-style cookies for a specified HOST and PATH" | 238 | "Retrieve all the netscape-style cookies for a specified HOST and PATH." |
| 236 | (let ((storage (if secure | 239 | (let ((storage (if secure |
| 237 | (append url-cookie-secure-storage url-cookie-storage) | 240 | (append url-cookie-secure-storage url-cookie-storage) |
| 238 | url-cookie-storage)) | 241 | url-cookie-storage)) |
| @@ -290,7 +293,7 @@ telling Microsoft that.") | |||
| 290 | (mapconcat 'identity (list "com" "edu" "net" "org" "gov" "mil" "int") | 293 | (mapconcat 'identity (list "com" "edu" "net" "org" "gov" "mil" "int") |
| 291 | "\\|") | 294 | "\\|") |
| 292 | "\\)$") | 295 | "\\)$") |
| 293 | "A regular expression of top-level domains that only require two matching | 296 | "A regexp of top level domains that only require two matching |
| 294 | '.'s in the domain name in order to set a cookie.") | 297 | '.'s in the domain name in order to set a cookie.") |
| 295 | 298 | ||
| 296 | (defcustom url-cookie-trusted-urls nil | 299 | (defcustom url-cookie-trusted-urls nil |
| @@ -442,25 +445,23 @@ to run the `url-cookie-setup-save-timer' function manually." | |||
| 442 | (defun url-cookie-setup-save-timer () | 445 | (defun url-cookie-setup-save-timer () |
| 443 | "Reset the cookie saver timer." | 446 | "Reset the cookie saver timer." |
| 444 | (interactive) | 447 | (interactive) |
| 445 | (cond | 448 | (ignore-errors |
| 446 | ((featurep 'itimer) | 449 | (cond ((fboundp 'cancel-timer) (cancel-timer url-cookie-timer)) |
| 447 | (ignore-errors (delete-itimer url-cookie-timer)) | 450 | ((fboundp 'delete-itimer) (delete-itimer url-cookie-timer)))) |
| 448 | (setq url-cookie-timer nil) | 451 | (setq url-cookie-timer nil) |
| 449 | (if url-cookie-save-interval | 452 | (if url-cookie-save-interval |
| 450 | (setq url-cookie-timer | 453 | (setq url-cookie-timer |
| 451 | (start-itimer "url-cookie-saver" 'url-cookie-write-file | 454 | (cond |
| 452 | url-cookie-save-interval | 455 | ((fboundp 'run-at-time) |
| 453 | url-cookie-save-interval)))) | ||
| 454 | ((fboundp 'run-at-time) | ||
| 455 | (ignore-errors (cancel-timer url-cookie-timer)) | ||
| 456 | (setq url-cookie-timer nil) | ||
| 457 | (if url-cookie-save-interval | ||
| 458 | (setq url-cookie-timer | ||
| 459 | (run-at-time url-cookie-save-interval | 456 | (run-at-time url-cookie-save-interval |
| 460 | url-cookie-save-interval | 457 | url-cookie-save-interval |
| 461 | 'url-cookie-write-file)))) | 458 | 'url-cookie-write-file)) |
| 462 | (t nil))) | 459 | ((fboundp 'start-itimer) |
| 460 | (start-itimer "url-cookie-saver" 'url-cookie-write-file | ||
| 461 | url-cookie-save-interval | ||
| 462 | url-cookie-save-interval)))))) | ||
| 463 | 463 | ||
| 464 | (provide 'url-cookie) | 464 | (provide 'url-cookie) |
| 465 | 465 | ||
| 466 | ;;; arch-tag: 2568751b-6452-4398-aa2d-303edadb54d7 | 466 | ;; arch-tag: 2568751b-6452-4398-aa2d-303edadb54d7 |
| 467 | ;;; url-cookie.el ends here | ||