* wl-draft.el (wl-draft-write-sendlog): Use `write-region-as-binary';
authorteranisi <teranisi>
Wed, 5 Dec 2001 09:00:08 +0000 (09:00 +0000)
committerteranisi <teranisi>
Wed, 5 Dec 2001 09:00:08 +0000 (09:00 +0000)
Use `with-temp-buffer'.

wl/ChangeLog
wl/wl-draft.el

index a1b0a75..5d4fdeb 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-05  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-draft.el (wl-draft-write-sendlog): Use `write-region-as-binary';
+       Use `with-temp-buffer'.
+
 2001-12-02  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * wl-folder.el (wl-folder-get-entity-id): Ignore nemacs (rewrite
index 72b62b9..c30d60f 100644 (file)
@@ -759,9 +759,8 @@ Reply to author if WITH-ARG is non-nil."
 (defun wl-draft-write-sendlog (status proto server to id)
   "Write send log file, if `wl-draft-sendlog' is non-nil."
   (when wl-draft-sendlog
-    (save-excursion
-      (let* ((tmp-buf (get-buffer-create " *wl-draft-sendlog*"))
-            (filename (expand-file-name wl-draft-sendlog-filename
+    (with-temp-buffer
+      (let* ((filename (expand-file-name wl-draft-sendlog-filename
                                         elmo-msgdb-dir))
             (filesize (nth 7 (file-attributes filename)))
             (server (if server (concat " server=" server) ""))
@@ -779,18 +778,15 @@ Reply to author if WITH-ARG is non-nil."
                   ""))
             (id (if id (concat " id=" id) ""))
             (time (wl-sendlog-time)))
-       (set-buffer tmp-buf)
-       (erase-buffer)
        (insert (format "%s proto=%s stat=%s%s%s%s\n"
                        time proto status server to id))
        (if (and wl-draft-sendlog-max-size filesize
                 (> filesize wl-draft-sendlog-max-size))
            (rename-file filename (concat filename ".old") t))
        (if (file-writable-p filename)
-           (write-region (point-min) (point-max)
-                         filename t 'no-msg)
-         (message (format "%s is not writable." filename)))
-       (kill-buffer tmp-buf)))))
+           (write-region-as-binary (point-min) (point-max)
+                                   filename t 'no-msg)
+         (message (format "%s is not writable." filename)))))))
 
 (defun wl-draft-get-header-delimiter (&optional delete)
   ;; If DELETE is non-nil, replace the header delimiter with a blank line