]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-convert-to-babyl-format): If the
authorKarl Heuer <kwzh@gnu.org>
Tue, 18 Nov 1997 21:13:57 +0000 (21:13 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 18 Nov 1997 21:13:57 +0000 (21:13 +0000)
message uses the quoted-printable content-transfer-encoding,
decode it into 8bit.

lisp/mail/rmail.el

index 06bfa89e733df94b70f6be11c07825645f699e4e..4bad2115fb3253e43b084ab897c9a966fe62cae4 100644 (file)
@@ -1431,6 +1431,14 @@ Optional DEFAULT is password to start with."
                                    (and (re-search-forward "\n\n" nil t)
                                         (1- (point)))))
                      (case-fold-search t)
+                     (quoted-printable-header-field-end
+                      (save-excursion
+                        ;; Back up to end of previous line, in case the
+                        ;; Content-Transfer-Encoding field comes first.
+                        (forward-char -1)
+                        (re-search-forward
+                         "\ncontent-transfer-encoding\\(\n?[\t ]\\)*:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*"
+                         header-end t)))
                      (size
                       ;; Get the numeric value from the Content-Length field.
                       (save-excursion
@@ -1460,18 +1468,29 @@ Optional DEFAULT is password to start with."
                                     (looking-at "From "))))
                          (goto-char (+ header-end size))
                        (message "Ignoring invalid Content-Length field")
-                       (sit-for 1 0 t))))
-
-              (if (re-search-forward
-                   (concat "^[\^_]?\\("
-                           rmail-unix-mail-delimiter
-                           "\\|"
-                           rmail-mmdf-delim1 "\\|"
-                           "^BABYL OPTIONS:\\|"
-                           "\^L\n[01],\\)") nil t)
-                  (goto-char (match-beginning 1))
-                (goto-char (point-max)))
-              (setq count (1+ count))
+                       (sit-for 1 0 t)))
+                (if (re-search-forward
+                     (concat "^[\^_]?\\("
+                             rmail-unix-mail-delimiter
+                             "\\|"
+                             rmail-mmdf-delim1 "\\|"
+                             "^BABYL OPTIONS:\\|"
+                             "\^L\n[01],\\)") nil t)
+                    (goto-char (match-beginning 1))
+                  (goto-char (point-max)))
+                (setq count (1+ count))
+                (if quoted-printable-header-field-end
+                    (save-excursion
+                      (save-restriction
+                        (narrow-to-region header-end (point))
+                        (require 'gnus-art)
+                        (article-mime-decode-quoted-printable-buffer))
+                      ;; Change "quoted-printable" to "8bit",
+                      ;; to reflect the decoding we just did.
+                      (goto-char quoted-printable-header-field-end)
+                      (zap-to-char -1 ?:)
+                      (insert ": 8bit"))))
+
               (save-excursion
                 (save-restriction
                   (narrow-to-region start (point))