* mime-view.el (mime-display-multipart/related): New function; set up
authorari <ari>
Thu, 14 Jun 2001 14:34:19 +0000 (14:34 +0000)
committerari <ari>
Thu, 14 Jun 2001 14:34:19 +0000 (14:34 +0000)
for `mime-preview-condition'.

ChangeLog
mime-view.el

index 5039c05..09b5f5b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-06-12  Yuuichi Teranishi <teranisi@gohome.org>
+
+       * mime-view.el (mime-display-multipart/related): When "start"
+       parameter specifies part, treat the part as root.
+
+2001-06-12  Akihiro Arisawa  <ari@mbf.sphere.ne.jp>
+
+       * mime-view.el (mime-display-multipart/related): New function; set up
+       for `mime-preview-condition'.
+
 2001-04-19  Katsumi Yamaoka   <yamaoka@jpl.org>
 
        * mime-bbdb.el: Load "bbdb-hooks" when the symbol function
index 8cdf3e7..64a4d10 100644 (file)
@@ -748,6 +748,12 @@ Each elements are regexp of field-name.")
 
 (ctree-set-calist-strictly
  'mime-preview-condition
+ '((type . multipart)(subtype . related)
+   (body . visible)
+   (body-presentation-method . mime-display-multipart/related)))
+
+(ctree-set-calist-strictly
+ 'mime-preview-condition
  '((type . multipart)(subtype . t)
    (body . visible)
    (body-presentation-method . mime-display-multipart/mixed)))
@@ -922,6 +928,22 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t.  t means default."
            situations (cdr situations)
            i (1+ i)))))
 
+(defun mime-display-multipart/related (entity situation)
+  (let* ((param-start (mime-parse-msg-id
+                      (std11-lexical-analyze
+                       (cdr (assoc "start"
+                                   (mime-content-type-parameters
+                                    (mime-entity-content-type entity)))))))
+        (start (or (and param-start (mime-find-entity-from-content-id
+                                     param-start
+                                     entity))
+                   (car (mime-entity-children entity))))
+        (original-major-mode-cell (assq 'major-mode situation))
+        (default-situation (cdr (assq 'childrens-situation situation))))
+    (if original-major-mode-cell
+       (setq default-situation
+             (cons original-major-mode-cell default-situation)))
+    (mime-display-entity start nil default-situation)))
 
 ;;; @ acting-condition
 ;;;