Synch up with main trunk, and prepare the release 2.12.0.
[elisp/wanderlust.git] / wl / wl-mime.el
index cde15e6..1606ee0 100644 (file)
@@ -69,18 +69,16 @@ has Non-nil value\)"
            (cond
             ((wl-region-exists-p)
              (wl-mime-preview-follow-current-region))
-            ((not (eq (get-text-property (point-min)
-                                         'wl-message-display-mime-mode)
-                      'mime))
+            ((not (wl-message-mime-analysis-p
+                   (wl-message-buffer-display-type)))
              (wl-mime-preview-follow-no-mime
-              (get-text-property (point-min)
-                                 'wl-message-display-mime-mode)))
+              (wl-message-buffer-display-type)))
             (t
              (mime-preview-follow-current-entity)))))
       (error "No message."))))
 
 ;; modified mime-preview-follow-current-entity from mime-view.el
-(defun wl-mime-preview-follow-no-mime (display-mode)
+(defun wl-mime-preview-follow-no-mime (display-type)
   "Write follow message to current message, without mime.
 It calls following-method selected from variable
 `mime-preview-following-method-alist'."
@@ -102,7 +100,8 @@ It calls following-method selected from variable
       (insert-buffer-substring the-buf beg end)
       (goto-char (point-min))
       ;; Insert all headers.
-      (let ((elmo-mime-display-header-analysis (not (eq display-mode 'as-is))))
+      (let ((elmo-mime-display-header-analysis
+            (wl-message-mime-analysis-p display-type 'header)))
        (elmo-mime-insert-sorted-header entity))
       (let ((f (cdr (assq mode mime-preview-following-method-alist))))
        (if (functionp f)
@@ -282,7 +281,7 @@ It calls following-method selected from variable
       (when wl-highlight-body-too
        (wl-highlight-body))
       (run-hooks 'wl-draft-preview-message-hook))
-    (make-local-variable 'kill-buffer-hook)
+    (make-local-hook 'kill-buffer-hook)
     (add-hook 'kill-buffer-hook
              (lambda ()
                (when (get-buffer-window
@@ -292,7 +291,8 @@ It calls following-method selected from variable
                  (delete-window))
                (when (get-buffer wl-draft-preview-attributes-buffer-name)
                  (kill-buffer (get-buffer
-                               wl-draft-preview-attributes-buffer-name)))))
+                               wl-draft-preview-attributes-buffer-name))))
+             nil t)
     (if (not wl-draft-preview-attributes)
        (message (concat "Recipients: "
                         (cdr (assq 'recipients attribute-list))))