* mml-generate-default-type
@ 2005-07-27 13:14 Reiner Steib
2005-07-28 5:39 ` mml-generate-default-type Katsumi Yamaoka
0 siblings, 1 reply; 4+ messages in thread
From: Reiner Steib @ 2005-07-27 13:14 UTC (permalink / raw)
Cc: Katsumi Yamaoka
Hi,
`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))
`----
(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))
(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.
Bye, Reiner.
[ Cc-ing Katsumi, who pointed me to `mml-generate-default-type' while
discussing a problem with `mml-attach-file'. Hopefully the ding
list will soon be up again. ]
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mml-generate-default-type
2005-07-27 13:14 mml-generate-default-type Reiner Steib
@ 2005-07-28 5:39 ` Katsumi Yamaoka
2005-07-28 13:14 ` mml-generate-default-type Reiner Steib
0 siblings, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka @ 2005-07-28 5:39 UTC (permalink / raw)
>>>>> In <v964uwxufq.fsf@marauder.physik.uni-ulm.de> 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".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-07-28 22:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-27 13:14 mml-generate-default-type Reiner Steib
2005-07-28 5:39 ` mml-generate-default-type Katsumi Yamaoka
2005-07-28 13:14 ` mml-generate-default-type Reiner Steib
2005-07-28 22:23 ` mml-generate-default-type Katsumi Yamaoka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).