From: hmurata Date: Fri, 11 Feb 2005 06:44:41 +0000 (+0000) Subject: (wl-summary-save): Use `write-region-as-binary' X-Git-Tag: wl-2_14-root~55 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b5792600f975feab6250ccbe25ed695bcccce79;p=elisp%2Fwanderlust.git (wl-summary-save): Use `write-region-as-binary' instead of `write-region' and simplify. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 2e78f75..0adace0 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2005-02-11 Hiroya Murata + + * wl-summary.el (wl-summary-save): Use `write-region-as-binary' + instead of `write-region' and simplify. + 2005-02-09 Hiroya Murata * wl-template.el (wl-template-select): Cause error if diff --git a/wl/wl-summary.el b/wl/wl-summary.el index e0c31be..755d1e0 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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))