From 9ae2b81a98b3174940a6ee9576acbd86fbc428ff Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 7 Aug 2002 13:14:48 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 15 +++++++++++++++ lisp/mm-bodies.el | 6 +++++- lisp/mm-uu.el | 29 +++++++++++++++++++++++++++++ texi/ChangeLog | 5 +++++ texi/emacs-mime.texi | 24 ++++++++++++++++++++++-- 5 files changed, 76 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ebcbb4..75edbf7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2002-08-07 Jesper harder + + * yenc.el: New file. + + * mm-uu.el (mm-uu-yenc-decode-function): New variable. + (mm-uu-type-alist): Add yenc. + (mm-uu-yenc-filename): New function. + (mm-uu-yenc-extract): New function. + + * mm-bodies.el (mm-decode-content-transfer-encoding): Add yenc. + +2002-08-06 ShengHuo ZHU + + * dgnushack.el (merge): Don't use coerce. + 2002-05-27 Jesper Harder * mailcap.el (mailcap-mime-data): Test window-system rather than diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index 19cd5a4..94b2c41 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -223,6 +223,10 @@ If TYPE is `text/plain' CRLF->LF translation may occur." (require 'mm-uu) (funcall mm-uu-binhex-decode-function (point-min) (point-max)) t) + ((eq encoding 'x-yenc) + (require 'mm-uu) + (funcall mm-uu-yenc-decode-function (point-min) (point-max)) + ) ((functionp encoding) (funcall encoding (point-min) (point-max)) t) @@ -232,7 +236,7 @@ If TYPE is `text/plain' CRLF->LF translation may occur." (message "Error while decoding: %s" error) nil)) (when (and - (memq encoding '(base64 x-uuencode x-uue x-binhex)) + (memq encoding '(base64 x-uuencode x-uue x-binhex x-yenc)) (equal type "text/plain")) (goto-char (point-min)) (while (search-forward "\r\n" nil t) diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index 96eaafb..0ff83a9 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -40,6 +40,9 @@ (autoload 'binhex-decode-region-external "binhex") (autoload 'binhex-decode-region-internal "binhex") +(autoload 'yenc-decode-region "yenc") +(autoload 'yenc-extract-filename "yenc") + (defcustom mm-uu-decode-function 'uudecode-decode-region "*Function to uudecode. Internal function is done in Lisp by default, therefore decoding may @@ -61,6 +64,8 @@ decoder, such as hexbin." (function-item :tag "External" binhex-decode-region-external)) :group 'gnus-article-mime) +(defvar mm-uu-yenc-decode-function 'yenc-decode-region) + (defvar mm-uu-pgp-beginning-signature "^-----BEGIN PGP SIGNATURE-----") @@ -90,6 +95,11 @@ This can be either \"inline\" or \"attachment\".") mm-uu-binhex-extract nil mm-uu-binhex-filename) + (yenc + "^=ybegin.*size=[0-9]+.*name=.*$" + "^=yend.*size=[0-9]+" + mm-uu-yenc-extract + mm-uu-yenc-filename) (shar "^#! */bin/sh" "^exit 0$" @@ -205,6 +215,12 @@ Return that buffer." (ignore-errors (binhex-decode-region start-point end-point t)))) +(defun mm-uu-yenc-filename () + (goto-char start-point) + (setq file-name + (ignore-errors + (yenc-extract-filename)))) + (defun mm-uu-forward-test () (save-excursion (goto-char start-point) @@ -262,6 +278,19 @@ Return that buffer." (list mm-dissect-disposition (cons 'filename file-name))))) +(defun mm-uu-yenc-extract () + (mm-make-handle (mm-uu-copy-to-buffer start-point end-point) + (list (or (and file-name + (string-match "\\.[^\\.]+$" file-name) + (mailcap-extension-to-mime + (match-string 0 file-name))) + "application/octet-stream")) + 'x-yenc nil + (if (and file-name (not (equal file-name ""))) + (list mm-dissect-disposition + (cons 'filename file-name))))) + + (defun mm-uu-shar-extract () (mm-make-handle (mm-uu-copy-to-buffer start-point end-point) '("application/x-shar"))) diff --git a/texi/ChangeLog b/texi/ChangeLog index 4b51606..def6da6 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2002-08-07 Jesper harder + + * emacs-mime.texi (Non-MIME): Add yenc. + (yenc): New node. + 2002-08-04 Lars Magne Ingebrigtsen * gnus.texi (Summary Sorting): Document randomization. diff --git a/texi/emacs-mime.texi b/texi/emacs-mime.texi index 0ddf342..5456fe9 100644 --- a/texi/emacs-mime.texi +++ b/texi/emacs-mime.texi @@ -132,8 +132,8 @@ descend the message, following the structure, and return a tree of @section Non-MIME Gnus also understands some non-@sc{mime} attachments, such as -postscript, uuencode, binhex, shar, forward, gnatsweb, pgp. Each of -these features can be disabled by add an item into +postscript, uuencode, binhex, yenc, shar, forward, gnatsweb, pgp. +Each of these features can be disabled by add an item into @code{mm-uu-configure-list}. For example, @lisp @@ -154,6 +154,10 @@ Uuencoded file. @findex binhex Binhex encoded file. +@item yenc +@findex yenc +Yenc encoded file. + @item shar @findex shar Shar archive file. @@ -1041,6 +1045,7 @@ on. High-level functionality is dealt with in the next chapter * base64:: Base64 en/decoding. * binhex:: Binhex decoding. * uudecode:: Uuencode decoding. +* yenc:: Yenc decoding. * rfc1843:: Decoding HZ-encoded text. * mailcap:: How parts are displayed is specified by the @file{.mailcap} file @end menu @@ -1482,6 +1487,21 @@ Decode the text in the region. @end table +@node yenc +@section yenc +@cindex yenc + +@code{yenc} is used for encoding binaries on Usenet. The following +function is supplied by this package: + +@table @code +@item yenc-decode-region +@findex yenc-decode-region +Decode the encoded text in the region. + +@end table + + @node rfc1843 @section rfc1843 @cindex rfc1843 -- 1.7.10.4