X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmm-uu.el;h=96eaafbb7fafdc6039d6122e3dc3e5a522b1ed6e;hb=9b741e050b400987d68ff761c6cc3276c932839c;hp=5f93e7bdc877e1bd9e260060106eb6e5da6992ee;hpb=104a4dfd02fa25e48924ef8ea1365279f636c6d6;p=elisp%2Fgnus.git- diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index 5f93e7b..96eaafb 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. +;;; mm-uu.el --- Return uu stuff as mm handles +;; Copyright (c) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ;; Author: Shenghuo Zhu ;; Keywords: postscript uudecode binhex shar forward gnatsweb pgp @@ -23,29 +23,31 @@ ;;; Commentary: - ;;; Code: (eval-when-compile (require 'cl)) (require 'mail-parse) (require 'nnheader) (require 'mm-decode) -(require 'mailcap) +(require 'gnus-mailcap) (require 'mml2015) -(require 'uudecode) -(require 'binhex) -;; This is not the right place for this. uudecode.el should decide -;; whether or not to use a program with a single interface, but I -;; guess it's too late now. Also the default should depend on a test -;; for the program. -- fx +(autoload 'uudecode-decode-region "uudecode") +(autoload 'uudecode-decode-region-external "uudecode") +(autoload 'uudecode-decode-region-internal "uudecode") + +(autoload 'binhex-decode-region "binhex") +(autoload 'binhex-decode-region-external "binhex") +(autoload 'binhex-decode-region-internal "binhex") + (defcustom mm-uu-decode-function 'uudecode-decode-region "*Function to uudecode. Internal function is done in Lisp by default, therefore decoding may appear to be horribly slow. You can make Gnus use an external decoder, such as uudecode." :type '(choice - (function-item :tag "Internal" uudecode-decode-region) + (function-item :tag "Auto detect" uudecode-decode-region) + (function-item :tag "Internal" uudecode-decode-region-internal) (function-item :tag "External" uudecode-decode-region-external)) :group 'gnus-article-mime) @@ -54,12 +56,13 @@ decoder, such as uudecode." Internal function is done in elisp by default, therefore decoding may appear to be horribly slow . You can make Gnus use the external Unix decoder, such as hexbin." - :type '(choice (item :tag "internal" binhex-decode-region) - (item :tag "external" binhex-decode-region-external)) + :type '(choice (function-item :tag "Auto detect" binhex-decode-region) + (function-item :tag "Internal" binhex-decode-region-internal) + (function-item :tag "External" binhex-decode-region-external)) :group 'gnus-article-mime) (defvar mm-uu-pgp-beginning-signature - "^-----BEGIN PGP SIGNATURE-----") + "^-----BEGIN PGP SIGNATURE-----") (defvar mm-uu-beginning-regexp nil) @@ -77,7 +80,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) @@ -174,12 +177,12 @@ Return that buffer." (if symbol (set-default symbol value)) (setq mm-uu-beginning-regexp nil) (mapcar (lambda (entry) - (if (mm-uu-configure-p (mm-uu-type entry) 'disabled) - nil - (setq mm-uu-beginning-regexp - (concat mm-uu-beginning-regexp - (if mm-uu-beginning-regexp "\\|") - (mm-uu-beginning-regexp entry))))) + (if (mm-uu-configure-p (mm-uu-type entry) 'disabled) + nil + (setq mm-uu-beginning-regexp + (concat mm-uu-beginning-regexp + (if mm-uu-beginning-regexp "\\|") + (mm-uu-beginning-regexp entry))))) mm-uu-type-alist)) (mm-uu-configure) @@ -372,7 +375,7 @@ Return that buffer." (mm-make-handle buf '("application/pgp-keys")))) -;;;### autoload +;;;###autoload (defun mm-uu-dissect () "Dissect the current buffer and return a list of uu handles." (let ((case-fold-search t) @@ -403,7 +406,7 @@ Return that buffer." (funcall func)) (forward-line);; in case of failure (when (and (not (mm-uu-configure-p (mm-uu-type entry) 'disabled)) - (let ((end-regexp (mm-uu-end-regexp entry))) + (let ((end-regexp (mm-uu-end-regexp entry))) (if (not end-regexp) (or (setq end-point (point-max)) t) (prog1