-(call-after-loaded
- 'mime-view
- (function
- (lambda ()
- (autoload 'mime-combine-message/partials-automatically
- "mime-partial"
- "Internal method to combine message/partial messages automatically.")
- (set-atype 'mime/content-decoding-condition
- '((type . "message/partial")
- (method . mime-combine-message/partials-automatically)
- (major-mode . mh-show-mode)
- (summary-buffer-exp
- . (and (or (string-match "^article-\\(.+\\)$" article-buffer)
- (string-match "^show-\\(.+\\)$" article-buffer))
- (substring article-buffer
- (match-beginning 1) (match-end 1))
- ))
- ))
- (set-alist 'mime-view-partial-message-method-alist
- 'mh-show-mode
- (function
- (lambda ()
- (let ((emh-automatic-mime-preview t))
- (emh-show)
- ))))
- )))
+(defun emh-request-partial-message ()
+ (let ((msg-filename (mh-msg-filename (mh-get-msg-num t)))
+ (show-buffer mh-show-buffer))
+ (set-buffer (get-buffer-create " *Partial Article*"))
+ (erase-buffer)
+ (setq mime-preview-buffer show-buffer)
+ (raw-text-insert-file-contents msg-filename)
+ (mime-parse-buffer)
+ ))
+
+(defun emh-get-folder-buffer ()
+ (let ((buffer-name (buffer-name (current-buffer))))
+ (and (or (string-match "^article-\\(.+\\)$" buffer-name)
+ (string-match "^show-\\(.+\\)$" buffer-name))
+ (substring buffer-name
+ (match-beginning 1) (match-end 1))
+ )))
+
+(autoload 'mime-combine-message/partial-pieces-automatically
+ "mime-partial"
+ "Internal method to combine message/partial messages automatically.")
+
+(mime-add-condition
+ 'action
+ '((type . message)(subtype . partial)
+ (major-mode . mh-show-mode)
+ (method . mime-combine-message/partial-pieces-automatically)
+ (summary-buffer-exp . (emh-get-folder-buffer))
+ (request-partial-message-method . emh-request-partial-message)
+ ))