From: tomo Date: Wed, 27 Dec 2000 12:11:15 +0000 (+0000) Subject: (mime-view-mailcap-files): New user option. X-Git-Tag: semi-1_14_3~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d4def78075050c9c72bb7c1e67c2284bf11733ca;p=elisp%2Fsemi.git (mime-view-mailcap-files): New user option. (mime-view-read-mailcap-files): Renamed from `mime-view-read-mailcap'; read `mime-view-mailcap-files'. --- diff --git a/mime-view.el b/mime-view.el index 8fb0a95..26593bb 100644 --- a/mime-view.el +++ b/mime-view.el @@ -66,6 +66,15 @@ buttom. Nil means don't scroll at all." (const :tag "On" t) (sexp :tag "Situation" 1))) +(defcustom mime-view-mailcap-files + (let ((files '("/etc/mailcap" "/usr/etc/mailcap" "~/.mailcap"))) + (or (member mime-mailcap-file files) + (setq files (cons mime-mailcap-file files))) + files) + "List of mailcap files." + :group 'mime-view + :type '(repeat file)) + ;;; @ in raw-buffer (representation space) ;;; @@ -917,33 +926,39 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (defvar mime-acting-condition nil "Condition-tree about how to process entity.") -(defun mime-view-read-mailcap () - (if (file-readable-p mime-mailcap-file) - (let ((entries (mime-parse-mailcap-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)) +(defun mime-view-read-mailcap-files (&optional files) + (or files + (setq files mime-view-mailcap-files)) + (let (entries file) + (while files + (setq file (car files)) + (if (file-readable-p file) + (setq entries (append entries (mime-parse-mailcap-file file)))) + (setq files (cdr files))) + (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-with-default + 'mime-acting-condition + (append shared (list '(mode . "play")(cons 'method (cdr view))))) + (if print (ctree-set-calist-with-default 'mime-acting-condition - (append shared (list '(mode . "play")(cons 'method (cdr view))))) - (if print - (ctree-set-calist-with-default - 'mime-acting-condition - (append shared - (list '(mode . "print")(cons 'method (cdr view))))))) - (setq entries (cdr entries)))))) - -(mime-view-read-mailcap) + (append shared + (list '(mode . "print")(cons 'method (cdr view))))))) + (setq entries (cdr entries))))) + +(mime-view-read-mailcap-files) (ctree-set-calist-strictly 'mime-acting-condition