Importing Pterodactyl Gnus v0.83.
[elisp/gnus.git-] / lisp / mm-encode.el
index 6db01ca..587abf8 100644 (file)
@@ -1,5 +1,5 @@
 ;;; mm-encode.el --- Functions for encoding MIME things
-;; Copyright (C) 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1998,99 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     MORIOKA Tomohiko <morioka@jaist.ac.jp>
@@ -29,7 +29,9 @@
 
 (defvar mm-content-transfer-encoding-defaults
   '(("text/.*" quoted-printable)
+    ("message/rfc822" 8bit)
     ("application/emacs-lisp" 8bit)
+    ("application/x-patch" 8bit)
     (".*" base64))
   "Alist of regexps that match MIME types and their encodings.")
 
       (goto-char (point-min))
       (while (search-forward "\n" nil t)
        (replace-match "\r\n" t t)))
-    (condition-case ()
+    (condition-case error
        (base64-encode-region (point-min) (point-max))
-      (error nil)))
+      (error
+       (message "Error while decoding: %s" error)
+       nil)))
    ((memq encoding '(7bit 8bit binary))
     )
    ((null encoding)
     )
-   ;;((eq encoding 'x-uuencode)
-   ;; (condition-case ()
-   ;;  (uudecode-encode-region (point-min) (point-max))
-   ;;   (error nil)))
    ((functionp encoding)
-    (condition-case ()
-       (funcall encoding (point-min) (point-max))
-      (error nil)))
+    (ignore-errors (funcall encoding (point-min) (point-max))))
    (t
     (message "Unknown encoding %s; defaulting to 8bit" encoding))))