X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mel-q.el;h=953b549e0742a64ec5e71f84b12c45ef8a203577;hb=6b3a5fdee70ec6d38cc8d3740c879bb992d212f9;hp=6200a744ce081e1aa6c49217ce0e1830afea3e6a;hpb=e8b4d182275a38437111e94a864f568dece6ef28;p=elisp%2Fflim.git diff --git a/mel-q.el b/mel-q.el index 6200a74..953b549 100644 --- a/mel-q.el +++ b/mel-q.el @@ -1,8 +1,8 @@ ;;; mel-q.el --- Quoted-Printable encoder/decoder. -;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. +;; Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. -;; Author: MORIOKA Tomohiko +;; Author: MORIOKA Tomohiko ;; Created: 1995/6/25 ;; Keywords: MIME, Quoted-Printable, Q-encoding @@ -20,13 +20,18 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: (require 'mime-def) (require 'path-util) +(eval-when-compile + ;; XXX: should provide char-list instead of string-to-char-list. + ;; XXx: and also the macro `as-binary-process' should be provided + ;; XXx: by the module "pces" which will be loaded by way of "poem". + (require 'poem)) ;;; @ Quoted-Printable encoder @@ -249,7 +254,8 @@ the program (maybe mmencode included in metamail or XEmacs package)." (defvar quoted-printable-external-decoder-option-to-specify-file '("-o") - "*list of options of quoted-printable decoder program to specify file.") + "*list of options of quoted-printable decoder program to specify file. +If the quoted-printable decoder does not have such option, set this as nil.") (mel-define-method mime-write-decoded-region (start end filename (nil "quoted-printable")) @@ -259,10 +265,18 @@ START and END are buffer positions." (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))))) + (null quoted-printable-external-decoder-option-to-specify-file) + (unless quoted-printable-external-decoder-option-to-specify-file + (list (current-buffer) nil)) + nil + (delq nil + (append + (cdr quoted-printable-external-decoder) + quoted-printable-external-decoder-option-to-specify-file + (when quoted-printable-external-decoder-option-to-specify-file + (list filename)))))) + (unless quoted-printable-external-decoder-option-to-specify-file + (write-region-as-binary (point-min) (point-max) filename))) ;;; @ Q-encoding encode/decode string