From: morioka Date: Thu, 12 Mar 1998 18:21:12 +0000 (+0000) Subject: (mailcap-file): New variable. X-Git-Tag: JR-Himi-~12 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=449d3184aaa0cb0dc808e7e5b04e9e7650593cf0;p=elisp%2Fsemi.git (mailcap-file): New variable. (mailcap-parse-file): New function. --- diff --git a/mailcap.el b/mailcap.el index fcc47b5..3bc3207 100644 --- a/mailcap.el +++ b/mailcap.el @@ -166,6 +166,21 @@ order. Otherwise result is not sorted." (t entries) )))) +(defvar mailcap-file "~/.mailcap" + "*File name of user's mailcap file.") + +(defun mailcap-parse-file (&optional filename order) + "Parse FILENAME as a mailcap, and return the result. +If optional argument ORDER is a function, result is sorted by it. +If optional argument ORDER is not specified, result is sorted original +order. Otherwise result is not sorted." + (or filename + (setq filename mailcap-file)) + (with-temp-buffer + (insert-file-contents filename) + (mailcap-parse-buffer (current-buffer) order) + )) + ;;; @ end ;;;