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

From: Michael Heerdegen <[email-masked]>
Date: Tue, 09 Apr 2013 16:17:37 +0200

Hello,

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).

I debugged a bit.  Here is what's going on:

M-x report-emacs-bug
--> compose-mail
--> (get mail-user-agent 'composefunc) == 'gnus-msg-mail
--> (gnus-setup-message 'message
	(message-mail to subject other-headers continue
		      nil yank-action send-actions return-action))

The macro `gnus-setup-message' binds `#:group' to the value of
`gnus-newsgroup-name', which is "nntp+Gmane:gmane.emacs.devel" in my
case.

Then it does this:

(add-hook 'message-mode-hook
          (if (memq ,config '(reply-yank reply))
              (lambda ()
                (gnus-configure-posting-styles ,group))
            (lambda ()
              ;; There may be an old " *gnus article copy*" buffer.
              (let (gnus-article-copy)
                (gnus-configure-posting-styles ,group)))))

At the end, running `message-mode-hook' changes the TO field
according to the posting style via `gnus-configure-posting-styles'.

Thanks,

Michael.

In GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2013-04-04 on dex, modified by Debian
 (emacs-snapshot package, version 2:20130403-1)
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux 7.0 (wheezy)

Configured using:
 `configure --build x86_64-linux-gnu --host x86_64-linux-gnu
 --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var --infodir=/usr/share/info --mandir=/usr/share/man
 --with-pop=yes
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.3.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3.50/site-lisp:/usr/share/emacs/site-lisp
 --without-compress-info --with-crt-dir=/usr/lib/x86_64-linux-gnu/
 --with-x=yes --with-x-toolkit=gtk3 --with-imagemagick=yes
 CFLAGS='-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2'
 CPPFLAGS='-D_FORTIFY_SOURCE=2' LDFLAGS='-g -Wl,--as-needed
 -znocombreloc''