From: Taylor R. Campbell Date: Thu, 23 Oct 2008 19:07:03 +0000 (+0000) Subject: New variable DEFAULT-MIME-TEXT-CHARSET to support specifying charsets X-Git-Tag: 20090517-FFI~96 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=50a88bd2b80273b6999e4ebf3c44a41689817eab;p=mit-scheme.git New variable DEFAULT-MIME-TEXT-CHARSET to support specifying charsets other than ISO-8859-1 in MIME text attachments. The existing behaviour is preserved; set this variable to the symbol PROMPT to change it. This is not carefully conceived, but I need it this hour! --- diff --git a/v7/src/edwin/sendmail.scm b/v7/src/edwin/sendmail.scm index 22cc78259..71b46e574 100644 --- a/v7/src/edwin/sendmail.scm +++ b/v7/src/edwin/sendmail.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: sendmail.scm,v 1.99 2008/08/15 20:46:12 riastradh Exp $ +$Id: sendmail.scm,v 1.100 2008/10/23 19:07:03 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -1804,9 +1804,26 @@ Otherwise, the MIME type is determined from the file's suffix; (else (editor-beep) (loop)))))))))))) (values mime-type (if (eq? (mime-type/top-level mime-type) 'TEXT) - '((CHARSET "iso-8859-1")) + (let ((charset + (ref-variable default-mime-text-charset buffer))) + (if (not charset) + '() + `((CHARSET + ,(if (eq? charset 'PROMPT) + (prompt-for-string "Charset:" "ISO-8859-1") + charset))))) '())))) +(define-variable default-mime-text-charset + "Default charset for MIME text/plain entities, as a string. +If #F, no charset is included. +If the symbol PROMPT, prompt for a charset." + "ISO-8859-1" + (lambda (object) + (or (string? object) + (eq? object 'PROMPT) + (eq? object #f)))) + (define-variable file-type-to-mime-type "Specifies the MIME type/subtype for files with a given type. This is a list, each element of which is a list of three items: