From: morioka Date: Sun, 11 Jan 1998 17:19:55 +0000 (+0000) Subject: mel of MEL 3.5. X-Git-Tag: mel-3_5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=025e3fdc81e0e8cadcfdeb733595d3f546c00c8a;p=elisp%2Fflim.git mel of MEL 3.5. --- diff --git a/mel-g.el b/mel-g.el new file mode 100644 index 0000000..fdc5ddb --- /dev/null +++ b/mel-g.el @@ -0,0 +1,89 @@ +;;; +;;; mel-g.el: Gzip64 encoder/decoder for GNU Emacs +;;; +;;; Copyright (C) 1995,1996 MORIOKA Tomohiko +;;; Copyright (C) 1996 Shuhei KOBAYASHI +;;; +;;; Author: MORIOKA Tomohiko +;;; Shuhei KOBAYASHI +;;; Created: 1995/10/25 +;;; Version: +;;; $Id: mel-g.el,v 1.1 1996/03/11 17:01:45 shuhei Exp $ +;;; Keywords: MIME, base64, gzip +;;; +;;; This file is not part of MEL (MIME Encoding Library) yet. +;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 2, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with This program. If not, write to the Free Software +;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;;; +;;; Code: + +;;; @ variables +;;; + +(defvar gzip64-external-encoder '("sh" "-c" "gzip -c | mmencode") + "*list of gzip64 encoder program name and its arguments.") + +(defvar gzip64-external-decoder '("sh" "-c" "mmencode -u | gzip -dc") + "*list of gzip64 decoder program name and its arguments.") + + +;;; @ external encoder +;;; + +(cond ((boundp 'MULE) + (define-program-coding-system + nil (car gzip64-external-encoder) *noconv*) + (define-program-coding-system + nil (car gzip64-external-decoder) *noconv*) + ) + ((boundp 'NEMACS) + (define-program-kanji-code + nil (car gzip64-external-encoder) 0) + (define-program-kanji-code + nil (car gzip64-external-decoder) 0) + )) + +(defun gzip64-external-encode-region (beg end) + (interactive "*r") + (save-excursion + (let (selective-display ; Disable ^M to nl translation. + mc-flag ; for Mule + kanji-flag) ; for NEmacs + (apply (function call-process-region) + beg end (car gzip64-external-encoder) + t t nil (cdr gzip64-external-encoder)) + ))) + +(defun gzip64-external-decode-region (beg end) + (interactive "*r") + (save-excursion + (let ((selective-display nil) ; Disable ^M to nl translation. + (mc-flag nil) ; for Mule + (kanji-flag nil)) ; for NEmacs + (apply (function call-process-region) + beg end (car gzip64-external-decoder) + t t nil (cdr gzip64-external-decoder)) + ))) + +(defalias 'gzip64-encode-region 'gzip64-external-encode-region) +(defalias 'gzip64-decode-region 'gzip64-external-decode-region) + + +;;; @ end +;;; + +(provide 'mel-g) + +;;; mel-g.el ends here. diff --git a/mel-q.el b/mel-q.el index 8a36840..486fa32 100644 --- a/mel-q.el +++ b/mel-q.el @@ -8,7 +8,7 @@ ;;; Maintainer: MORIOKA Tomohiko ;;; Created: 1995/6/25 ;;; Version: -;;; $Id: mel-q.el,v 3.1 1996/01/09 18:28:53 morioka Exp $ +;;; $Id: mel-q.el,v 3.2 1996/03/11 14:29:31 morioka Exp $ ;;; Keywords: MIME, Quoted-Printable ;;; ;;; This file is part of MEL (MIME Encoding Library). @@ -29,7 +29,6 @@ ;;; ;;; Code: - ;;; @ constants ;;; @@ -62,6 +61,11 @@ external decoder is called.") ;;; @ Quoted-Printable (Q-encode) encoder/decoder ;;; +(defun byte-to-hex-string (num) + (concat (char-to-string (elt quoted-printable-hex-chars (ash num -4))) + (char-to-string (elt quoted-printable-hex-chars (logand num 15))) + )) + (defun quoted-printable-quote-char (chr) (concat "=" (char-to-string (elt quoted-printable-hex-chars (ash chr -4))) @@ -323,3 +327,5 @@ external decoder is called.") ;;; (provide 'mel-q) + +;;; mel-q.el ends here diff --git a/mel.el b/mel.el index 1f7fbf9..062a417 100644 --- a/mel.el +++ b/mel.el @@ -5,11 +5,12 @@ ;;; Copyright (C) 1995,1996 MORIOKA Tomohiko ;;; ;;; Author: MORIOKA Tomohiko +;;; modified by Shuhei KOBAYASHI ;;; Maintainer: MORIOKA Tomohiko ;;; Created: 1995/6/25 ;;; Version: -;;; $Id: mel.el,v 3.3 1996/01/09 18:31:08 morioka Exp $ -;;; Keywords: MIME, Quoted-Printable +;;; $Id: mel.el,v 3.5 1996/03/13 16:05:41 morioka Exp $ +;;; Keywords: MIME, Base64, Quoted-Printable, uuencode, gzip64 ;;; ;;; This file is part of MEL (MIME Encoding Library). ;;; @@ -48,10 +49,14 @@ (autoload 'uuencode-encode-region "mel-u" nil t) (autoload 'uuencode-decode-region "mel-u" nil t) +(autoload 'gzip64-encode-region "mel-g" nil t) +(autoload 'gzip64-decode-region "mel-g" nil t) + (defvar mime-encoding-method-alist '(("base64" . base64-encode-region) ("quoted-printable" . quoted-printable-encode-region) ("x-uue" . uuencode-encode-region) + ("x-gzip64" . gzip64-encode-region) ("7bit") ("8bit") ("binary") @@ -61,6 +66,7 @@ '(("base64" . base64-decode-region) ("quoted-printable" . quoted-printable-decode-region) ("x-uue" . uuencode-decode-region) + ("x-gzip64" . gzip64-decode-region) )) @@ -101,3 +107,5 @@ ;;; (provide 'mel) + +;;; mel.el ends here.