+2010-11-10 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
+
+ * mime-view.el (mime-view-type-subtype-score-alist): Accept
+ function as an alternate of score.
+ (mime-view-type-subtype-score-alist): Likewise.
+
2010-10-24 Vitaly Mayatskikh <v.mayatskih@gmail.com>
* mime-view.el (mime-save-situation-examples): Don't fail when
((text . plain) . 1)
(t . 0))
"Alist MEDIA-TYPE vs corresponding score.
-MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default."
+MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default.
+Score is integer or function which receives entity and returns integer."
:group 'mime-view
:type '(repeat (cons (choice :tag "Media-Type"
(cons :tag "Type/Subtype"
(symbol :tag "Subtype"))
(symbol :tag "Type")
(const :tag "Default" t))
- integer)))
+ (choice (integer :tag "score")
+ (function :tag "function")))))
(defun mime-display-multipart/alternative (entity situation)
(let* ((children (mime-entity-children entity))
t
mime-view-type-subtype-score-alist)
))))
+ (when (functionp score)
+ (setq score (funcall score child)))
(if (> score max-score)
(setq p i
max-score score)