From: morioka Date: Sun, 3 May 1998 17:48:40 +0000 (+0000) Subject: (mime-acting-condition): Read mailcap. X-Git-Tag: semi-1_4_0~31 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=201a089a1df1a367f006ef9e65bc24683b469694;p=elisp%2Fsemi.git (mime-acting-condition): Read mailcap. --- diff --git a/mime-view.el b/mime-view.el index 1b6b183..a4ff9a7 100644 --- a/mime-view.el +++ b/mime-view.el @@ -33,6 +33,7 @@ (require 'mime-parse) (require 'semi-def) (require 'calist) +(require 'mailcap) ;;; @ version @@ -507,6 +508,35 @@ if it is not nil.") (defvar mime-acting-condition nil "Condition-tree about how to process entity.") +(if (file-readable-p mailcap-file) + (let ((entries (mailcap-parse-file))) + (while entries + (let ((entry (car entries)) + view print shared) + (while entry + (let* ((field (car entry)) + (field-type (car field))) + (cond ((eq field-type 'view) (setq view field)) + ((eq field-type 'print) (setq print field)) + ((memq field-type '(compose composetyped edit))) + (t (setq shared (cons field shared)))) + ) + (setq entry (cdr entry)) + ) + (setq shared (nreverse shared)) + (ctree-set-calist-strictly + 'mime-acting-condition + (append shared (list '(mode . "play")(cons 'method (cdr view))))) + (if print + (ctree-set-calist-strictly + 'mime-acting-condition + (append shared + (list '(mode . "print")(cons 'method (cdr view)))) + )) + ) + (setq entries (cdr entries)) + ))) + (ctree-set-calist-strictly 'mime-acting-condition '((type . t)(subtype . t)(mode . "play")