comparison lisp/url/url-cookie.el @ 67723:f0ddbd3730d3

(url-cookie-write-file): Create parent dir.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 21 Dec 2005 20:08:49 +0000
parents 5c87802be570
children 63366306c117 d0eee3282e6b
comparison
equal deleted inserted replaced
67722:3a3904075d3d 67723:f0ddbd3730d3
146 (set var new))) 146 (set var new)))
147 147
148 ;;;###autoload 148 ;;;###autoload
149 (defun url-cookie-write-file (&optional fname) 149 (defun url-cookie-write-file (&optional fname)
150 (setq fname (or fname url-cookie-file)) 150 (setq fname (or fname url-cookie-file))
151 (unless (file-directory-p (file-name-directory fname))
152 (ignore-errors (make-directory (file-name-directory fname))))
151 (cond 153 (cond
152 ((not url-cookies-changed-since-last-save) nil) 154 ((not url-cookies-changed-since-last-save) nil)
153 ((not (file-writable-p fname)) 155 ((not (file-writable-p fname))
154 (message "Cookies file %s (see variable `url-cookie-file') is unwritable." fname)) 156 (message "Cookies file %s (see variable `url-cookie-file') is unwritable." fname))
155 (t 157 (t
156 (url-cookie-clean-up) 158 (url-cookie-clean-up)
157 (url-cookie-clean-up t) 159 (url-cookie-clean-up t)
158 (save-excursion 160 (with-current-buffer (get-buffer-create " *cookies*")
159 (set-buffer (get-buffer-create " *cookies*"))
160 (erase-buffer) 161 (erase-buffer)
161 (fundamental-mode) 162 (fundamental-mode)
162 (insert ";; Emacs-W3 HTTP cookies file\n" 163 (insert ";; Emacs-W3 HTTP cookies file\n"
163 ";; Automatically generated file!!! DO NOT EDIT!!!\n\n" 164 ";; Automatically generated file!!! DO NOT EDIT!!!\n\n"
164 "(setq url-cookie-storage\n '") 165 "(setq url-cookie-storage\n '")