emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b84b689: Revert recent mm-with-part change


From: Lars Ingebrigtsen
Subject: master b84b689: Revert recent mm-with-part change
Date: Sun, 10 Jan 2021 07:30:39 -0500 (EST)

branch: master
commit b84b6897464f5af69d24a4efa95704ab51b3cd7b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Revert recent mm-with-part change
    
    * lisp/gnus/mm-decode.el (mm-with-part): Revert
    23a887e426f81033b0de2f4c93a8525cb31c28da -- this is the wrong
    place to handle this peculiarity.
---
 lisp/gnus/mm-decode.el            | 19 +++++--------------
 test/lisp/gnus/mm-decode-tests.el | 16 ----------------
 2 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 2b0b61b..61946aa 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1264,20 +1264,11 @@ in HANDLE."
      (when (and (mm-handle-buffer handle)
                (buffer-name (mm-handle-buffer handle)))
        (with-temp-buffer
-        (if (and (eq (mm-handle-encoding handle) '8bit)
-                 (with-current-buffer (mm-handle-buffer handle)
-                   enable-multibyte-characters))
-            ;; Due to unfortunate historical reasons, we may have a
-            ;; multibyte buffer here, but if it's using an 8bit
-            ;; Content-Transfer-Encoding, then work around that by
-            ;; just ignoring the situation.
-            (insert-buffer-substring (mm-handle-buffer handle))
-          ;; Do the decoding.
-          (mm-disable-multibyte)
-          (insert-buffer-substring (mm-handle-buffer handle))
-          (mm-decode-content-transfer-encoding
-           (mm-handle-encoding handle)
-           (mm-handle-media-type handle)))
+        (mm-disable-multibyte)
+        (insert-buffer-substring (mm-handle-buffer handle))
+        (mm-decode-content-transfer-encoding
+         (mm-handle-encoding handle)
+         (mm-handle-media-type handle))
         ,@forms))))
 (put 'mm-with-part 'lisp-indent-function 1)
 (put 'mm-with-part 'edebug-form-spec '(body))
diff --git a/test/lisp/gnus/mm-decode-tests.el 
b/test/lisp/gnus/mm-decode-tests.el
index 6e8fae6..7d059cb 100644
--- a/test/lisp/gnus/mm-decode-tests.el
+++ b/test/lisp/gnus/mm-decode-tests.el
@@ -70,22 +70,6 @@
                                                        'charset)))
                        "ääää\n"))))))
 
-(ert-deftest test-mm-with-part-multibyte ()
-  (with-temp-buffer
-    (set-buffer-multibyte t)
-    (nnheader-insert-file-contents (ert-resource-file "8bit-multipart.bin"))
-    (while (search-forward "\r\n" nil t)
-      (replace-match "\n"))
-    (let ((handle (mm-dissect-buffer)))
-      (pop handle)
-      (let ((part (pop handle)))
-        (should (equal (decode-coding-string
-                        (mm-with-part part
-                          (buffer-string))
-                        (intern (mail-content-type-get (mm-handle-type part)
-                                                       'charset)))
-                       "ääää\n"))))))
-
 (ert-deftest test-mm-dissect-buffer-win1252 ()
   (with-temp-buffer
     (set-buffer-multibyte nil)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]