Synch with Oort Gnus.
[elisp/gnus.git-] / lisp / mm-uu.el
index 0a78298..96eaafb 100644 (file)
@@ -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 <zsh@cs.rochester.edu>
 ;; Keywords: postscript uudecode binhex shar forward gnatsweb pgp
 (require 'mm-decode)
 (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)
 
@@ -53,8 +56,9 @@ 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
@@ -76,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)
@@ -371,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)