;;; mel-b.el: Base64 encoder/decoder for GNU Emacs
-;; Copyright (C) 1992,1995,1996,1997 Free Software Foundation, Inc.
+;; Copyright (C) 1992,1995,1996,1997,1998 Free Software Foundation, Inc.
;; Author: ENAMI Tsugutomo <enami@sys.ptg.sony.co.jp>
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1995/6/24
-;; Version: $Id: mel-b.el,v 6.3 1997/04/30 17:17:42 morioka Exp $
;; Keywords: MIME, Base64
;; This file is part of MEL (MIME Encoding Library).
(defvar base64-external-decoder '("mmencode" "-u")
"*list of base64 decoder program name and its arguments.")
+(defvar base64-external-decoder-option-to-specify-file '("-o")
+ "*list of options of base64 decoder program to specify file.")
+
(defvar base64-internal-encoding-limit 1000
"*limit size to use internal base64 encoder.
If size of input to encode is larger than this limit,
filename t nil (cdr base64-external-encoder))
)
+(defun base64-write-decoded-region (start end filename)
+ "Decode and write current region encoded by base64 into FILENAME.
+START and END are buffer positions."
+ (interactive
+ (list (region-beginning) (region-end)
+ (read-file-name "Write decoded region to file: ")))
+ (as-binary-process
+ (apply (function call-process-region)
+ start end (car base64-external-decoder)
+ nil nil nil
+ (append (cdr base64-external-decoder)
+ base64-external-decoder-option-to-specify-file
+ (list filename))
+ )))
+
;;; @ etc
;;;