* mm-decode.el (mm-get-part): Don't use mm-with-unibyte-current-buffer.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 3 Mar 2006 04:29:09 +0000 (04:29 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 3 Mar 2006 04:29:09 +0000 (04:29 +0000)
* gnus-sum.el (gnus-summary-set-display-table): Don't nix out characters 160
 through 255 in Emacs 23.

lisp/ChangeLog
lisp/gnus-sum.el
lisp/mm-decode.el

index 414e727..ae61a70 100644 (file)
@@ -1,3 +1,11 @@
+2006-03-03  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-decode.el (mm-get-part): Don't use
+       mm-with-unibyte-current-buffer.
+
+       * gnus-sum.el (gnus-summary-set-display-table): Don't nix out
+       characters 160 through 255 in Emacs 23.
+
 2006-03-02  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-art.el (gnus-article-browse-html-temp-list): Rename from
index e944d0d..980c54b 100644 (file)
@@ -3293,8 +3293,11 @@ display only a single character."
     (aset table ?\r nil)
     ;; We keep TAB as well.
     (aset table ?\t nil)
-    ;; We nix out any glyphs over 126 that are not set already.
-    (let ((i 256))
+    ;; We nix out any glyphs 127 through 255, or 127 through 159 in
+    ;; Emacs 23, that are not set already.
+    (let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160))
+                160
+              256)))
       (while (>= (setq i (1- i)) 127)
        ;; Only modify if the entry is nil.
        (unless (aref table i)
index f2e2a15..a807b9c 100644 (file)
@@ -1078,14 +1078,16 @@ external if displayed external."
 
 (defun mm-get-part (handle)
   "Return the contents of HANDLE as a string."
-  (mm-with-unibyte-buffer
-    (insert (with-current-buffer (mm-handle-buffer handle)
-             (mm-with-unibyte-current-buffer
-               (buffer-string))))
-    (mm-decode-content-transfer-encoding
-     (mm-handle-encoding handle)
-     (mm-handle-media-type handle))
-    (buffer-string)))
+  (let ((default-enable-multibyte-characters
+         (with-current-buffer (mm-handle-buffer handle)
+           (mm-multibyte-p))))
+    (with-temp-buffer
+      (insert-buffer-substring (mm-handle-buffer handle))
+      (mm-disable-multibyte)
+      (mm-decode-content-transfer-encoding
+       (mm-handle-encoding handle)
+       (mm-handle-media-type handle))
+      (buffer-string))))
 
 (defun mm-insert-part (handle)
   "Insert the contents of HANDLE in the current buffer."