Subject: bug#14166: 24.3.50; report-emacs-bug and mail-user-agent == 'gnus-user-agent

From: Katsumi Yamaoka <[email-masked]>
Date: Wed, 10 Apr 2013 14:52:06 +0900

Michael Heerdegen wrote:
> the problem is the following (with my setup):

> - I have an active gnus; currently, I'm having a summary buffer showing
>   the emacs-dev newsgroup.  I need it for reference for the composition
>   of a bug report.

> - I do M-x report-emacs-bug

> The result is that the mail composition buffer will have a TO field of
> "[email-masked]" instead of "[email-masked]".
> `report-emacs-bug' uses the posting-style of the group I'm currently
> reading.  Surprising, and not very useful.

> Background: I use mail-user-agent == 'gnus-user-agent.  Not sure if
> there are other related settings.

> And I have this element in `gnus-posting-styles':

> ("\\(?:\\(?:g\\(?:\\(?:mane\\|nu\\)\\.emacs\\.devel\\)\\)\\)\\'"
>   (TO "[email-masked]")
>   (BCC #1="[email-masked]")
>   . #2=((FCC nil)))

> mainly because I read emacs-devel as a group, but want to reply always
> to the mailing list (I know about S L, but I want also to be able to use
> the standard reply commands.  Please tell me if that's a bad idea).

[...]

There seem to be several solutions, however ideas I have are not
so good.  For example:

1. To make `report-emacs-bug' bind `gnus-posting-styles' to nil
   unconditionally while performing `compose-mail'.  It has to load
   gnus-msg.el, that provides `gnus-posting-styles', before binding
   it to nil if Gnus is not running yet even if `mail-user-agent'
   is not `gnus-user-agent'.  Otherwise, `gnus-posting-styles' will
   be made unbound.  Note that a function `gnus-user-agent' uses,
   that is `gnus-msg-mail', is autoloaded, and it involves many other
   Gnus modules loading.

2. Similar to 1.  But load gnus-msg.el and bind `gnus-posting-styles'
   to nil if and only if `mail-user-agent' equals `gnus-user-agent'.
   I think the source code for it will get ugly.

3. To make `gnus-msg-mail' bind `gnus-posting-styles' to nil if and
   only if `this-command' is `report-emacs-bug'.  It won't work if
   `report-emacs-bug' is called non-interactively.

My second best is 2.  What do others think?