From 1cea6740bf2c6c4daf5b1b38746d635b078d5a26 Mon Sep 17 00:00:00 2001 From: tmorioka Date: Sat, 1 Mar 1997 04:12:37 +0000 Subject: [PATCH] (charsets-to-mime-charset): New function; copied from emu.el. --- mime-def.el | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/mime-def.el b/mime-def.el index 4cc7917..988d696 100644 --- a/mime-def.el +++ b/mime-def.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Id: mime-def.el,v 0.36 1997-03-01 04:06:22 tmorioka Exp $ +;; Version: $Id: mime-def.el,v 0.37 1997-03-01 04:12:37 tmorioka Exp $ ;; Keywords: definition, MIME, multimedia, mail, news ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). @@ -126,6 +126,33 @@ (intern (concat (symbol-name cs) "-" (symbol-name lbt))) cs))) +(defun charsets-to-mime-charset (charsets) + "Return MIME charset from list of charset CHARSETS. +This function refers variable `charsets-mime-charset-alist' +and `default-mime-charset'. [emu.el]" + (if charsets + (or (catch 'tag + (let ((rest charsets-mime-charset-alist) + cell csl) + (while (setq cell (car rest)) + (if (catch 'not-subset + (let ((set1 charsets) + (set2 (car cell)) + obj) + (while set1 + (setq obj (car set1)) + (or (memq obj set2) + (throw 'not-subset nil) + ) + (setq set1 (cdr set1)) + ) + t)) + (throw 'tag (cdr cell)) + ) + (setq rest (cdr rest)) + ))) + default-mime-charset))) + (defun detect-mime-charset-region (start end) "Return MIME charset for region between START and END." (charsets-to-mime-charset -- 1.7.10.4