Always inline top-level MIME text parts, even if the subtype isn't
authorChris Hanson <org/chris-hanson/cph>
Wed, 14 Jun 2000 20:16:37 +0000 (20:16 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 14 Jun 2000 20:16:37 +0000 (20:16 +0000)
"plain".  Also, define new variable imail-known-mime-charsets, to
allow the user to add other character sets that may be inlined.

v7/src/imail/imail-top.scm
v7/src/imail/imail.pkg

index acfd36d9b405dac1fba8a2e001fe8975c6047ad5..4c648e96bad9d7be202eb157e135831265ac4325 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-top.scm,v 1.152 2000/06/14 02:24:50 cph Exp $
+;;; $Id: imail-top.scm,v 1.153 2000/06/14 20:16:21 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
@@ -149,6 +149,13 @@ Otherwise, only the header fields normally shown by IMAIL are sent."
 Otherwise, they are inserted into the message body."
   #t
   boolean?)
+
+(define-variable imail-known-mime-charsets
+  "List of regular expressions matching character-set names.
+Text messages using these character sets are displayed inline;
+ when other character sets are used, the text is treated as an attachment."
+  (list "us-ascii" "iso-8859-[0-9]+" "windows-[0-9]+")
+  list-of-strings?)
 \f
 (define-command imail
   "Read and edit incoming mail.
@@ -459,6 +466,7 @@ variable's documentation (using \\[describe-variable]) for details:
     imail-forward-using-mime
     imail-ignored-headers
     imail-kept-headers
+    imail-known-mime-charsets
     imail-message-filter
     imail-mode-hook
     imail-pass-phrase-retention-time
@@ -1109,15 +1117,17 @@ With prefix argument N moves backward N messages with these flags."
                ;; This is illegal, but Netscape does it.
                encoding
                (mime-body-one-part-encoding body)))))
-    (if (and (eq? (mime-body-subtype body) 'PLAIN)
+    (if (and (or (not enclosure)
+                (eq? (mime-body-subtype body) 'PLAIN))
             (known-mime-encoding? encoding)
-            (re-string-match (string-append "\\`"
-                                            (regexp-group "us-ascii"
-                                                          "iso-8859-[0-9]+"
-                                                          "windows-[0-9]+")
-                                            "\\'")
-                             (mime-body-parameter body 'CHARSET "us-ascii")
-                             #t))
+            (re-string-match
+             (string-append "\\`"
+                            (apply regexp-group
+                                   (ref-variable imail-known-mime-charsets
+                                                 mark))
+                            "\\'")
+             (mime-body-parameter body 'CHARSET "us-ascii")
+             #t))
        (let ((text
               (message-mime-body-part
                message
index 144025cb471c831a6a3c8c72433e0810acb987c4..8d73bc3385bd6791b68471d5c6706091e4b798a9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail.pkg,v 1.56 2000/06/14 02:24:54 cph Exp $
+;;; $Id: imail.pkg,v 1.57 2000/06/14 20:16:37 cph Exp $
 ;;;
 ;;; Copyright (c) 2000 Massachusetts Institute of Technology
 ;;;
          edwin-variable$imail-forward-using-mime
          edwin-variable$imail-ignored-headers
          edwin-variable$imail-kept-headers
+         edwin-variable$imail-known-mime-charsets
          edwin-variable$imail-message-filter
          edwin-variable$imail-mode-hook
          edwin-variable$imail-pass-phrase-retention-time