* mm-uu.el (mm-uu-dissect): Allow optional arg.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 6 Oct 2004 07:48:57 +0000 (07:48 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 6 Oct 2004 07:48:57 +0000 (07:48 +0000)
(mm-uu-dissect-text-parts): New function.

* gnus-art.el (gnus-display-mime): Use mm-uu-dissect-text-parts to
dissect text parts.

* gnus-sum.el (gnus-summary-force-verify-and-decrypt): Revert
2004-08-18 change.

* mm-decode.el (mm-dissect-singlepart): Revert 2004-08-18 change.

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

index 2d61fd7..e4d0dd3 100644 (file)
@@ -1,5 +1,16 @@
 2004-10-06  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * mm-uu.el (mm-uu-dissect): Allow optional arg.
+       (mm-uu-dissect-text-parts): New function.
+
+       * gnus-art.el (gnus-display-mime): Use mm-uu-dissect-text-parts to
+       dissect text parts.
+
+       * gnus-sum.el (gnus-summary-force-verify-and-decrypt): Revert
+       2004-08-18 change.
+
+       * mm-decode.el (mm-dissect-singlepart): Revert 2004-08-18 change.
+
        * gnus-topic.el (gnus-topic-hierarchical-parameters): Use
        gnus-current-topics instead of gnus-current-topic.
 
index a0ea71a..65da913 100644 (file)
@@ -4540,11 +4540,15 @@ N is the numerical prefix."
          ;; We have to do this since selecting the window
          ;; may change the point.  So we set the window point.
          (set-window-point window point)))
-      (let* ((handles (or ihandles
-                         (mm-dissect-buffer nil gnus-article-loose-mime)
-                         (and gnus-article-emulate-mime
-                              (mm-uu-dissect))))
-            (inhibit-read-only t) handle name type b e display)
+      (let ((handles ihandles)
+           (inhibit-read-only t)
+           handle name type b e display)
+       (cond (handles)
+             ((setq handles (mm-dissect-buffer nil gnus-article-loose-mime))
+              (when gnus-article-emulate-mime
+                (mm-uu-dissect-text-parts handles)))
+             (gnus-article-emulate-mime
+              (setq handles (mm-uu-dissect))))
        (when (and (not ihandles)
                   (not gnus-displaying-mime))
          ;; Top-level call; we clean up.
index 4b13eac..ff836bf 100644 (file)
@@ -7166,7 +7166,6 @@ be displayed."
   (let ((mm-verify-option 'known)
        (mm-decrypt-option 'known)
        (gnus-article-emulate-mime t)
-       (mm-fill-flowed nil)
        (gnus-buttonized-mime-types (append (list "multipart/signed"
                                                  "multipart/encrypted")
                                            gnus-buttonized-mime-types)))
index dfd4153..225f821 100644 (file)
@@ -579,11 +579,7 @@ Postpone undisplaying of viewers for types in
 (defun mm-dissect-singlepart (ctl cte &optional force cdl description id)
   (when (or force
            (if (equal "text/plain" (car ctl))
-               ;; FIXME: This is a kludge.  Proper fix is to make
-               ;; gnus-display-mime invoke mm-uu-dissect on all
-               ;; textual MIME parts, and stop using mm-fill-flowed
-               ;; here.
-               (and mm-fill-flowed (assoc 'format ctl))
+               (assoc 'format ctl)
              t))
     (mm-make-handle
      (mm-copy-to-buffer) ctl cte nil cdl description nil id)))
index 17fa593..1f71154 100644 (file)
@@ -1,5 +1,6 @@
 ;;; mm-uu.el --- Return uu stuff as mm handles
-;; Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+;; Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+;;        Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: postscript uudecode binhex shar forward gnatsweb pgp
@@ -430,14 +431,16 @@ Return that buffer."
                    '("application/pgp-keys"))))
 
 ;;;###autoload
-(defun mm-uu-dissect ()
-  "Dissect the current buffer and return a list of uu handles."
+(defun mm-uu-dissect (&optional noheader)
+  "Dissect the current buffer and return a list of uu handles.
+The optional NOHEADER means there's no header in the buffer."
   (let ((case-fold-search t)
        text-start start-point end-point file-name result
        text-plain-type entry func)
     (save-excursion
       (goto-char (point-min))
       (cond
+       (noheader)
        ((looking-at "\n")
        (forward-line))
        ((search-forward "\n\n" nil t)
@@ -493,6 +496,22 @@ Return that buffer."
        (setq result (cons "multipart/mixed" (nreverse result))))
       result)))
 
+(defun mm-uu-dissect-text-parts (handle)
+  "Dissect text parts and put uu handles into HANDLE."
+  (let ((buffer (mm-handle-buffer handle))
+       children)
+    (cond ((stringp buffer)
+          (mapc 'mm-uu-dissect-text-parts (cdr handle)))
+         ((bufferp buffer)
+          (when (and (equal "text/plain" (mm-handle-media-type handle))
+                     (with-current-buffer buffer
+                       (setq children (mm-uu-dissect t))))
+            (kill-buffer buffer)
+            (setcar handle (car children))
+            (setcdr handle (cdr children))))
+         (t
+          (mapc 'mm-uu-dissect-text-parts handle)))))
+
 (provide 'mm-uu)
 
 ;;; arch-tag: 7db076bf-53db-4320-aa19-ca76a1d2ab2c