From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60643 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: mml-generate-default-type Date: Thu, 28 Jul 2005 14:39:35 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1122529867 16712 80.91.229.2 (28 Jul 2005 05:51:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2005 05:51:07 +0000 (UTC) Original-X-From: ding-owner+M9171@lists.math.uh.edu Thu Jul 28 07:51:02 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dy1Hw-0001Gd-TU for ding-account@gmane.org; Thu, 28 Jul 2005 07:50:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1Dy17g-0001ID-00; Thu, 28 Jul 2005 00:40:00 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1Dy17W-0001I8-00 for ding@lists.math.uh.edu; Thu, 28 Jul 2005 00:39:50 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1Dy17V-0005LN-6y for ding@lists.math.uh.edu; Thu, 28 Jul 2005 00:39:49 -0500 Original-Received: from washington.hostforweb.net ([66.225.201.13]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Dy17U-0000yn-00 for ; Thu, 28 Jul 2005 07:39:48 +0200 Original-Received: from localhost.servershost.net ([127.0.0.1] helo=localhost) by washington.hostforweb.net with esmtpa (Exim 4.50) id 1Dy17i-0006Iu-IS for ding@gnus.org; Thu, 28 Jul 2005 00:40:02 -0500 Original-To: ding@gnus.org X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:9h4R0FI3rGfaNghqDU+GP/9VAT8= X-Hashcash: 1:20:050728:ding@gnus.org::GaMQRBCNQkg3A6WC:00008nqb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -3.5 (---) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60643 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60643 >>>>> In Reiner Steib wrote: > `M-x grep RET mml-generate-default-type SPC *.el RET' (in the v5-10 > branch) gives: > ,---- >| grep -nH -e mml-generate-default-type *.el >| mml.el:126:(defvar mml-generate-default-type "text/plain") >| mml.el:440: (mml-generate-default-type "text/plain")) >| mml.el:537: (mml-generate-default-type (if (equal type "digest") >| mml.el:633: (not (equal type mml-generate-default-type)) > `---- I looked into it and realized the reason why `mml-generate-default-type' is needed to be a variable, not a constant. It is a variable, but users must not modify the value! > (1) Is there a good reason for the let-binding in line 440? > (let ((mml-boundary (mml-compute-boundary cont)) > (mml-generate-default-type "text/plain")) > (mml-to-mime)) It is because `mml-generate-mime-1' is called recursively when a user marks two or more articles and forwards them in a single message. In that case, `mml-generate-default-type' is bound as "message/rfc822" for encoding each entire article at the first time, but it should be "text/plain" to encode each body at the second time. The reason it is bound as "message/rfc822" at the first time is to prevent the `Content-Type: message/rfc822' header being inserted in each article part. It is also the reason of the following. > (2) The code... > (when (or charset > parameters > flowed > (not (equal type mml-generate-default-type)) > mml-insert-mime-headers-always) > [...] > (insert "Content-Type: " type) > ... suggests that `mml-generate-default-type' is the default > Content-Type that doesn't need to be declared according to the > relevant RFC(s). In this case, `mml-generate-default-type' should > probably be a constant, I think. And it should get a doc string. The code is used not only to omit the `Content-Type: text/plain' header but also to suppress inserting of the `Content-Type: message/rfc822' header. In the later case, `mml-generate-default-type' is bound as "message/rfc822".