(wl-summary-save): Use `write-region-as-binary'
authorhmurata <hmurata>
Fri, 11 Feb 2005 06:44:41 +0000 (06:44 +0000)
committerhmurata <hmurata>
Fri, 11 Feb 2005 06:44:41 +0000 (06:44 +0000)
instead of `write-region' and simplify.

wl/ChangeLog
wl/wl-summary.el

index 2e78f75..0adace0 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-11  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl-summary.el (wl-summary-save): Use `write-region-as-binary'
+       instead of `write-region' and simplify.
+
 2005-02-09  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-template.el (wl-template-select): Cause error if
index e0c31be..755d1e0 100644 (file)
@@ -4708,25 +4708,23 @@ If ARG is numeric number, decode message as following:
   (interactive)
   (let ((filename)
        (num (wl-summary-message-number)))
-    (if (null wl-save-dir)
-       (setq wl-save-dir wl-temporary-file-directory))
+    (unless wl-save-dir
+      (setq wl-save-dir wl-temporary-file-directory))
     (if num
        (save-excursion
          (setq filename (expand-file-name
                          (concat (int-to-string num)
                                  wl-summary-save-file-suffix)
                          wl-save-dir))
-         (if (null (and arg
-                        (null (file-exists-p filename))))
-             (setq filename
-                   (read-file-name "Save to file: " filename)))
-
+         (when (or (null arg)
+                   (file-exists-p filename))
+           (setq filename (read-file-name "Save to file: " filename)))
          (wl-summary-set-message-buffer-or-redisplay)
          (set-buffer (wl-message-get-original-buffer))
-         (if (and (null arg) (file-exists-p filename))
-             (if (y-or-n-p "File already exists.  override it? ")
-                 (write-region (point-min) (point-max) filename))
-           (write-region (point-min) (point-max) filename)))
+         (when (or arg
+                   (not (file-exists-p filename))
+                   (y-or-n-p "File already exists.  override it? "))
+           (write-region-as-binary (point-min) (point-max) filename)))
       (message "No message to save."))
     num))