From: morioka Date: Wed, 3 Jun 1998 00:33:22 +0000 (+0000) Subject: (mime-raw-write-region): New implementation; refer X-Git-Tag: remi-1_5_0_9~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b35732a899a1571426abde3bd8a03ac9db75e88;p=elisp%2Fsemi.git (mime-raw-write-region): New implementation; refer `mime-raw-representation-type' or `mime-raw-representation-type-alist' instead of `mime-raw-buffer-coding-system-alist'. --- diff --git a/mime-play.el b/mime-play.el index 1bf476d..cbcf623 100644 --- a/mime-play.el +++ b/mime-play.el @@ -445,15 +445,17 @@ It is registered to variable `mime-preview-quitting-method-alist'." "Write current region into specified file. When called from a program, takes three arguments: START, END and FILENAME. START and END are buffer positions. -It refer `mime-raw-buffer-coding-system-alist' to choose coding-system -to write." - (let ((coding-system-for-write - (cdr - (or (assq major-mode mime-raw-buffer-coding-system-alist) - (assq t mime-raw-buffer-coding-system-alist) - )))) - (write-region start end filename) - )) +It refer `mime-raw-representation-type' or `major-mode +mime-raw-representation-type-alist'. If it is `binary', region is +saved as binary. Otherwise the region is saved by `write-region'." + (let ((presentation-type + (or mime-raw-representation-type + (cdr (or (assq major-mode mime-raw-representation-type-alist) + (assq t mime-raw-representation-type-alist)))))) + (if (eq presentation-type 'binary) + (write-region-as-binary start end filename) + (write-region start end filename) + ))) (defun mime-method-to-store-message/partial (beg end cal) (goto-char beg)