From 1420f5ab66d254bbb3eace62456676145c2563f3 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 18 Jun 2007 10:57:44 +0000 Subject: [PATCH] (mime-write-decoded-region): Define method function that uses built-in base64-decode-region. [cf. ] --- ChangeLog | 5 +++++ mel.el | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index d476c95..8be54e8 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) -- 1.7.10.4