- (let ((beg (mime-entity-point-min entity-info))
- (end (mime-entity-point-max entity-info))
- (c-type (mime-entity-media-type entity-info))
- (c-subtype (mime-entity-media-subtype entity-info))
- (params (mime-entity-parameters entity-info))
- (encoding (mime-entity-encoding entity-info))
- )
- (or c-type
- (setq c-type 'text
- c-subtype 'plain))
- ;; Check for VM
- (if (< beg (point-min))
- (setq beg (point-min))
- )
- (if (< (point-max) end)
- (setq end (point-max))
- )
- (let (method cal ret)
- (setq cal (list* (cons 'type c-type)
- (cons 'subtype c-subtype)
- (cons 'encoding encoding)
- (cons 'major-mode major-mode)
- params))
- (if mode
- (setq cal (cons (cons 'mode mode) cal))
- )
- (setq ret
- (or (ctree-match-calist mime-acting-situation-examples cal)
- (ctree-match-calist-partially mime-acting-situation-examples cal)
- cal))
- (setq ret
- (or (ctree-find-calist mime-acting-condition ret
- mime-view-find-every-acting-situation)
- (ctree-find-calist mime-acting-condition cal
- mime-view-find-every-acting-situation)
- ))
- (cond ((cdr ret)
- (setq ret (select-menu-alist
- "Methods"
- (mapcar (function
- (lambda (situation)
- (cons
- (format "%s"
- (cdr (assq 'method situation)))
- situation)))
- ret)))
- (ctree-set-calist-strictly 'mime-acting-situation-examples ret)
- )
- (t
- (setq ret (car ret))
- ))
- (setq method (cdr (assq 'method ret)))
- (cond ((and (symbolp method)
- (fboundp method))
- (funcall method beg end ret)
- )
- ((and (listp method)(stringp (car method)))
- (mime-activate-external-method beg end ret)
- )
- (t
- (mime-show-echo-buffer
- "No method are specified for %s\n"
- (mime-type/subtype-string c-type c-subtype))
- ))
- )
+ (let ((ret
+ (mime-unify-situations (mime-entity-situation entity situation)
+ mime-acting-condition
+ mime-acting-situation-example-list
+ 'method ignored-method
+ mime-play-find-every-situations))
+ method)
+ (setq mime-acting-situation-example-list (cdr ret)
+ ret (car ret))
+ (cond ((cdr ret)
+ (setq ret (select-menu-alist
+ "Methods"
+ (mapcar (function
+ (lambda (situation)
+ (cons
+ (format "%s"
+ (cdr (assq 'method situation)))
+ situation)))
+ ret)))
+ (setq ret (mime-sort-situation ret))
+ (add-to-list 'mime-acting-situation-example-list (cons ret 0))
+ )
+ (t
+ (setq ret (car ret))
+ ))
+ (setq method (cdr (assq 'method ret)))
+ (cond ((and (symbolp method)
+ (fboundp method))
+ (funcall method entity ret)
+ )
+ ((stringp method)
+ (mime-activate-mailcap-method entity ret)
+ )
+ ;; ((and (listp method)(stringp (car method)))
+ ;; (mime-activate-external-method entity ret)
+ ;; )
+ (t
+ (mime-show-echo-buffer "No method are specified for %s\n"
+ (mime-type/subtype-string
+ (cdr (assq 'type situation))
+ (cdr (assq 'subtype situation))))
+ (if (y-or-n-p "Do you want to save current entity to disk?")
+ (mime-save-content entity situation))
+ ))