]> code.delx.au - gnu-emacs/blobdiff - lisp/url/url-cookie.el
Merge from emacs-23; up to 2010-06-12T17:12:15Z!cyd@stupidchicken.com.
[gnu-emacs] / lisp / url / url-cookie.el
index 78dccac19c2d963e9ffb298dc9a6b01e5fc0a65a..78afa1633b6a07b0d84e4b3ef845922b7ec9430c 100644 (file)
@@ -1,7 +1,6 @@
 ;;; url-cookie.el --- URL cookie support
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2004, 2005, 2006, 2007, 2008,
-;;   2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2011  Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
@@ -27,6 +26,8 @@
 (require 'url-util)
 (require 'url-parse)
 
+(eval-when-compile (require 'cl))      ; defstruct
+
 (defgroup url-cookie nil
   "URL cookies."
   :prefix "url-"
   :group 'url)
 
 ;; A cookie is stored internally as a vector of 7 slots
-;; [ cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ]
+;; [ url-cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ]
 
 (defstruct (url-cookie
             (:constructor url-cookie-create)
             (:copier nil)
-            ;; For compatibility with a previous version which did not use
-            ;; defstruct, and also in order to make sure that the printed
-            ;; representation does not depend on CL internals, we use an
-            ;; explicitly managed tag.
-            (:type vector))
-  (tag 'cookie :read-only t)
+            (:type vector)
+            :named)
   name value expires localpart domain secure)
 
 (defvar url-cookie-storage nil         "Where cookies are stored.")
@@ -76,8 +73,6 @@ telling Microsoft that."
   ;; It's completely normal for the cookies file not to exist yet.
   (load (or fname url-cookie-file) t t))
 
-(declare-function url-cookie-p "url-cookie" t t) ; defstruct
-
 (defun url-cookie-clean-up (&optional secure)
   (let ((var (if secure 'url-cookie-secure-storage 'url-cookie-storage))
        new new-cookies)
@@ -330,9 +325,8 @@ telling Microsoft that."
           (not trusted)
           (save-window-excursion
             (with-output-to-temp-buffer "*Cookie Warning*"
-              (mapcar
-               (lambda (x)
-                 (princ (format "%s - %s" (car x) (cdr x)))) rest))
+              (dolist (x rest)
+                 (princ (format "%s - %s" (car x) (cdr x)))))
             (prog1
                 (not (funcall url-confirmation-func
                               (format "Allow %s to set these cookies? "