Subject: Re: bug#10897: sending mail via report-emacs-bug

From: Thierry Volpiatto <[email-masked]>
Date: Sat, 03 Mar 2012 18:08:36 +0100

Lars Magne Ingebrigtsen <[email-masked]> writes:

> Thierry Volpiatto <[email-masked]> writes:
>
>> I use same configuration for Emacs-24.0.92 and 24.0.94 and behavior is
>> different. (i.e nothing in 'to' and 'subject' for 24.0.94)
>>
>> Note: My Gnus configuration is not new and works fine since months (years).
>
> Well, I'm not able to reproduce the bug.
>
> So do you have anything in your setup that could clear the headers?
Ok I found:

--8<---------------cut here---------------start------------->8---
(defun gnus-msg-mail (&optional to subject other-headers continue
				switch-action yank-action send-actions return-action)
  "Start editing a mail message to be sent.
Like `message-mail', but with Gnus paraphernalia, particularly the
Gcc: header for archiving purposes.
If Gnus isn't running, a plain `message-mail' setup is used
instead."
  (interactive)
  (if (not (gnus-alive-p))
      (message-mail)

[...]
--8<---------------cut here---------------end--------------->8---

`compose-mail' is calling `gnus-msg-mail' which have changed and call
`message-mail' with no arguments unless a gnus session is alive.

Fallback to old version of `gnus-msg-mail' and all works fine.

--8<---------------cut here---------------start------------->8---
(defun gnus-msg-mail (&optional to subject other-headers continue
		      switch-action yank-action send-actions return-action)
  "Start editing a mail message to be sent.
Like `message-mail', but with Gnus paraphernalia, particularly the
Gcc: header for archiving purposes."
  (interactive)
  (let ((buf (current-buffer))
	mail-buf)
    (gnus-setup-message 'message
      (message-mail to subject other-headers continue
		    nil yank-action send-actions return-action))
    (when switch-action
      (setq mail-buf (current-buffer))
      (switch-to-buffer buf)
      (apply switch-action mail-buf nil)))
  ;; COMPOSEFUNC should return t if succeed.  Undocumented ???
  t)
--8<---------------cut here---------------end--------------->8---

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997