changeset 63379:70cb4d2371b4

(url-file, url-file-asynch-callback): Use with-current-buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 13 Jun 2005 14:32:42 +0000
parents 32d8df63f9df
children 10ceeb0364c5
files lisp/url/ChangeLog lisp/url/url-file.el
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/ChangeLog	Mon Jun 13 14:21:21 2005 +0000
+++ b/lisp/url/ChangeLog	Mon Jun 13 14:32:42 2005 +0000
@@ -1,3 +1,7 @@
+2005-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* url-file.el (url-file, url-file-asynch-callback): with-current-buffer.
+
 2005-06-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* url-dav.el: Remove most autoload cookies.
--- a/lisp/url/url-file.el	Mon Jun 13 14:21:21 2005 +0000
+++ b/lisp/url/url-file.el	Mon Jun 13 14:32:42 2005 +0000
@@ -73,8 +73,7 @@
 	    func args
 	    args efs))
   (let ((size (nth 7 (file-attributes name))))
-    (save-excursion
-      (set-buffer buff)
+    (with-current-buffer buff
       (goto-char (point-max))
       (if (/= -1 size)
 	  (insert (format "Content-length: %d\n" size)))
@@ -177,9 +176,8 @@
     (if (file-directory-p filename)
 	;; A directory is done the same whether we are local or remote
 	(url-find-file-dired filename)
-      (save-excursion
-	(setq buffer (generate-new-buffer " *url-file*"))
-	(set-buffer buffer)
+      (with-current-buffer
+	  (setq buffer (generate-new-buffer " *url-file*"))
 	(mm-disable-multibyte)
 	(setq url-current-object url)
 	(insert "Content-type: " (or content-type "application/octet-stream") "\n")