From: morioka Date: Wed, 11 Mar 1998 15:43:20 +0000 (+0000) Subject: (base64-external-decoder-option-to-specify-file): New variable. X-Git-Tag: mel-7_2~9 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a0a62365fcf263796084ca44d8e61dba40bfd1b9;p=elisp%2Fflim.git (base64-external-decoder-option-to-specify-file): New variable. (base64-write-decoded-region): New function. --- diff --git a/mel-b.el b/mel-b.el index 1ea0cb4..4c16f5e 100644 --- a/mel-b.el +++ b/mel-b.el @@ -1,12 +1,10 @@ ;;; 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 ;; MORIOKA Tomohiko -;; Maintainer: MORIOKA Tomohiko ;; 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). @@ -40,6 +38,9 @@ (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, @@ -265,6 +266,21 @@ mmencode included in metamail or XEmacs package)." 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 ;;;