From: yamaoka Date: Mon, 18 Jun 2007 10:58:54 +0000 (+0000) Subject: (mime-write-decoded-region): Define method function that uses built-in X-Git-Tag: flim-1_14_9-pre0~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9a2810b39be533b0df9d1fc3732b2b5cb35fcd0;p=elisp%2Fflim.git (mime-write-decoded-region): Define method function that uses built-in base64-decode-region. [cf. ] --- diff --git a/ChangeLog b/ChangeLog index 4e0771b..3ebb33b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-18 Wencheng Fang + + * mel.el (mime-write-decoded-region): Define method function that + uses built-in base64-decode-region. [cf. ] + 2006-12-20 MORIOKA Tomohiko * README.ja, README.en (Installation): Update required version of diff --git a/mel.el b/mel.el index 44d7a70..90534cb 100644 --- a/mel.el +++ b/mel.el @@ -176,6 +176,15 @@ mmencode included in metamail or XEmacs package)." (binary-insert-encoded-file filename) (buffer-string)))) (or (bolp) (insert ?\n))) + (mel-define-method mime-write-decoded-region (start end filename + (nil "base64")) + "Decode the region from START to END and write out to FILENAME." + (interactive "*r\nFWrite decoded region to file: ") + (let ((str (buffer-substring start end))) + (with-temp-buffer + (insert str) + (base64-decode-region (point-min) (point-max)) + (write-region-as-binary (point-min) (point-max) filename)))) ;; (mel-define-method-function (encoded-text-encode-string string (nil "B")) ;; 'base64-encode-string)