X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fmm-uu.el;h=e7770baf7c677d705f7780cd0394e84ee98fccc3;hb=4a2dc496fb84b51e96b430723a07a39b5c8fc7fb;hp=f36a5fdc0f63f81016ba4125b8527c8bd60abbc7;hpb=cb0d937e62fd11aa7c7cb44e3492a0274ef55a52;p=gnus diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index f36a5fdc0..e7770baf7 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -1,5 +1,5 @@ ;;; mm-uu.el --- Return uu stuff as mm handles -;; Copyright (c) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +;; Copyright (c) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ;; Author: Shenghuo Zhu ;; Keywords: postscript uudecode binhex shar forward gnatsweb pgp @@ -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-----") @@ -80,7 +85,7 @@ This can be either \"inline\" or \"attachment\".") mm-uu-postscript-extract nil) (uu - "^begin[ \t]+[0-7][0-7][0-7][ \t]+" + "^begin[ \t]+0?[0-7][0-7][0-7][ \t]+" "^end[ \t]*$" mm-uu-uu-extract mm-uu-uu-filename) @@ -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$" @@ -131,7 +141,7 @@ This can be either \"inline\" or \"attachment\".") nil mm-uu-emacs-sources-test))) -(defcustom mm-uu-configure-list nil +(defcustom mm-uu-configure-list '((shar . disabled)) "A list of mm-uu configuration. To disable dissecting shar codes, for instance, add `(shar . disabled)' to this list." @@ -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")))