Subject: Re: bug#55014: 29.0.50; mml-generate-mime gets error

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 19 Apr 2022 13:44:08 +0200

Richard Stallman <[email-masked]> writes:

> I had this in my *mail* buffer (in Mail mode):
>
> ======================================================================
> Content-Type: text/plain; charset=Utf-8
> From: Richard Stallman <[email-masked]>
> To: rms
> Subject: 
> Reply-To: [email-masked]
>
> Test.
>
> <#part type="application/pdf" filename="~/foo.pdf" disposition=attachment>
> <#/part>
> ======================================================================
>
> I ran (mml-secure-message-sign-pgpmime), then typed C-c C-c
> and got an error from mml-generate-mime, that assq returned nil here:
>
> 	(setcdr (assq 'type (cdr (car cont))) content-type))
>
> cont contained this.

This is because you're asking Emacs to do something impossible -- you've
put a header into the buffer saying it's a text/plain message, but
you're trying to create a multipart message.

So if you remove that Content-Type header, things will work fine.

I've now added a test for this situation so that it doesn't bug out in
Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no