Subject: bug#10842: Cancelling a new mail in message-mode ignores rmail-mail-new-frame

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 23 Sep 2019 17:12:01 +0200

Glenn Morris <[email-masked]> writes:

> emacs -Q \
>   --eval "(setq rmail-mail-new-frame t mail-user-agent 'sendmail-user-agent)"
> M-x rmail
> m
>   -> new frame appears for mail composition
> Choose Mail menu, Cancel
>   -> frame disappears

And it should disappear, so that's the bug?  What command does that
"Cancel" menu run?

Glenn Morris <[email-masked]> writes:

> Lars Ingebrigtsen wrote:
>
>> This is an rmail bug and not a Message bug, I guess?
>
> I don't really see how it could be. At first glance, it seems that
> message-kill-buffer does not run message-bury, and hence does not
> process the return-action of compose-mail. Compare with
> message-dont-send, which does delete the frame.

message-dont-send is return-action, which is documented as

---
RETURN-ACTION, if non-nil, is an action for returning to the
caller.  It has the form (FUNCTION . ARGS).  The function is
called after the mail has been sent or put aside, and the mail
buffer buried.
---

message-kill-buffer isn't what's meant by return-action in the
compose-mail interface, I think?

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