From f41b7c8c269ea1e3a341e6fe2add84ab9359495b Mon Sep 17 00:00:00 2001 From: morioka Date: Wed, 11 Mar 1998 15:51:30 +0000 Subject: [PATCH] (quoted-printable-external-decoder-option-to-specify-file): New variable. (quoted-printable-write-decoded-region): New function. --- mel-q.el | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/mel-q.el b/mel-q.el index 72a2276..63d95fb 100644 --- a/mel-q.el +++ b/mel-q.el @@ -1,10 +1,9 @@ ;;; mel-q.el: Quoted-Printable and Q-encoding encoder/decoder for GNU Emacs -;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko ;; Created: 1995/6/25 -;; Version: $Id: mel-q.el,v 7.1 1997/11/06 16:09:25 morioka Exp $ ;; Keywords: MIME, Quoted-Printable, Q-encoding ;; This file is part of MEL (MIME Encoding Library). @@ -88,6 +87,7 @@ ))) ))))) + (defvar quoted-printable-external-encoder '("mmencode" "-q") "*list of quoted-printable encoder program name and its arguments.") @@ -108,6 +108,7 @@ ) ))) + (defvar quoted-printable-internal-encoding-limit (if (and (featurep 'xemacs)(featurep 'mule)) 0 @@ -135,6 +136,7 @@ the program (maybe mmencode included in metamail or XEmacs package)." (quoted-printable-internal-encode-region start end) )) + (defun quoted-printable-encode-string (string) "Encode STRING to quoted-printable, and return the result." (with-temp-buffer @@ -143,6 +145,7 @@ the program (maybe mmencode included in metamail or XEmacs package)." (buffer-string) )) + (defun quoted-printable-insert-encoded-file (filename) "Encode contents of file FILENAME to quoted-printable, and insert the result. It calls external quoted-printable encoder specified by @@ -208,6 +211,7 @@ It calls external quoted-printable encoder specified by )) ))) + (defvar quoted-printable-external-decoder '("mmencode" "-q" "-u") "*list of quoted-printable decoder program name and its arguments.") @@ -219,6 +223,7 @@ It calls external quoted-printable encoder specified by t t nil (cdr quoted-printable-external-decoder)) ))) + (defvar quoted-printable-internal-decoding-limit nil "*limit size to use internal quoted-printable decoder. If size of input to decode is larger than this limit, @@ -239,6 +244,25 @@ the program (maybe mmencode included in metamail or XEmacs package)." (quoted-printable-internal-decode-region start end) )) + +(defvar quoted-printable-external-decoder-option-to-specify-file '("-o") + "*list of options of quoted-printable decoder program to specify file.") + +(defun quoted-printable-write-decoded-region (start end filename) + "Decode and write current region encoded by quoted-printable 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 quoted-printable-external-decoder) + nil nil nil + (append (cdr quoted-printable-external-decoder) + quoted-printable-external-decoder-option-to-specify-file + (list filename)) + ))) + ;;; @ Q-encoding encode/decode string ;;; -- 1.7.10.4