bug#62345: [workaround] Composing mail from secondary frame does not generate Gcc: header
Felix Natter via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]> Sat, 19 Apr 2025 20:26:26 +0200
| Newsgroups | gmane.emacs.bugs,gmane.emacs.gnus.general |
|---|---|
| Message-ID | <[email protected]> |
Dear Emacs / Gnus experts,
with regard to this:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62345
(TL;DR: "C-x 5 m" / "C-x 5 2, then m" fail to add a Gcc: header)
I am using (standard config from the manual):
(setq gnus-message-archive-group
'((if (message-news-p)
"sent-news"
(concat "sent-mail." (format-time-string "%Y-%m")))))
Here is my analysis of the problem (Emacs 30.1, Gnus 5.13) (below I
analyzed C-x 5 m, but C-x 5 2, then m works as well, so it seems to be
similar):
- gnus-inews-insert-gcc is responsible for adding the Gcc: header
- C-x 5 m (compose-mail-other-frame) differs substantially from m
(gnus-group-mail):
- m (OK case): gnus-group-mail calls
(gnus-setup-message 'message (message-mail))
at the very end
- C-x 5 m (FAIL case): compose-mail-other-frame also calls (message-mail=
)
(according to edebug backtrace) in some way I don't understand but doe=
s NOT
call gnus-setup-message
- gnus-setup-message creates the Gcc: creation hook:
(add-hook 'message-header-setup-hook (lambda ()
(gnus-inews-insert-gcc ,group)))
- message-setup-1 (called by both OK and FAIL) runs message-header-setup-h=
ook:
(which is null/nil in the FAIL / C-x 5 m case):
(save-restriction
(message-narrow-to-headers)
(run-hooks 'message-header-setup-hook))
workaround: I changed message-setup-1 (gnus-msg.el) to:
(save-restriction
(message-narrow-to-headers)
(if (null message-header-setup-hook)
(gnus-inews-insert-gcc "")
(run-hooks 'message-header-setup-hook)))
Which works for me so far. Is this workaround anywhere *close* to becoming=
a fix?
I know it is not ready, but am I anywhere on the right track, and could so=
meone
please help?
- gnus-setup-message: what does
(group (make-symbol "gnus-setup-message-group")) and then
(gnus-inews-insert-gcc ,group) do?
- how do I check whether message-header-setup-hook contains a
"gnus-inews-insert-gcc" hook instead of checking for null?
(P.S.: rather check for existance of Gcc: after having run the hook,
that should be easy)
- or, as an alternative solution: can we make compose-mail-other-frame
(transitively) call gnus-setup-message (for that I would need to underst=
and
how compose-mail calls message-mail)?
Many Thanks and Best Regards!
Felix
=2D-=20
Felix Natter