changeset 110343:94013d67543b

* lisp/url/url-cache (url-store-in-cache): Make `buff' argument really optional.
author Glenn Morris <rgm@gnu.org>
date Fri, 10 Sep 2010 18:55:55 -0700
parents ba563485f83b
children cad11be547dd
files lisp/url/ChangeLog lisp/url/url-cache.el
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/ChangeLog	Thu Sep 09 20:04:26 2010 -0700
+++ b/lisp/url/ChangeLog	Fri Sep 10 18:55:55 2010 -0700
@@ -1,3 +1,7 @@
+2010-09-11  Julien Danjou  <julien@danjou.info>
+
+	* url-cache (url-store-in-cache): Make `buff' argument really optional.
+
 2010-09-09  Glenn Morris  <rgm@gnu.org>
 
 	* url-cookie.el (url-cookie-expired-p): Tweak previous change.
--- a/lisp/url/url-cache.el	Thu Sep 09 20:04:26 2010 -0700
+++ b/lisp/url/url-cache.el	Fri Sep 10 18:55:55 2010 -0700
@@ -62,14 +62,11 @@
 ;;;###autoload
 (defun url-store-in-cache (&optional buff)
   "Store buffer BUFF in the cache."
-  (if (not (and buff (get-buffer buff)))
-      nil
-    (save-current-buffer
-      (and buff (set-buffer buff))
-      (let* ((fname (url-cache-create-filename (url-view-url t))))
-	(if (url-cache-prepare fname)
-	    (let ((coding-system-for-write 'binary))
-	      (write-region (point-min) (point-max) fname nil 5)))))))
+    (with-current-buffer (get-buffer (or buff (current-buffer)))
+      (let ((fname (url-cache-create-filename (url-view-url t))))
+        (if (url-cache-prepare fname)
+            (let ((coding-system-for-write 'binary))
+              (write-region (point-min) (point-max) fname nil 5))))))
 
 ;;;###autoload
 (defun url-is-cached (url)