From ffdd1c3b1384ecf145aea490c4fe31ce04c7bdc7 Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 12 Mar 1998 19:31:22 +0000 Subject: [PATCH] Sync with main branch. --- mailcap.el | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mailcap.el b/mailcap.el index fcc47b5..f3b82ce 100644 --- a/mailcap.el +++ b/mailcap.el @@ -61,9 +61,9 @@ (forward-char) (let ((subtype (mailcap-look-at-token))) (if subtype - (cons (cons 'type type) + (cons (cons 'type (intern type)) (unless (string= subtype "*") - (list (cons 'subtype subtype)) + (list (cons 'subtype (intern subtype))) )))))))) @@ -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 ;;; -- 1.7.10.4