Subject: [PATCH] gnus-request-head generates bogus group names

From: Dave Abrahams <[email-masked]>
Date: Sun, 19 Aug 2012 22:26:46 -0400

When called (indirectly) from `gnus-summary-refer-article',
`gnus-request-head' forwards the current group name, rather than the
group where the message will eventually be found, to the backend
`request-head' function.  This can result in bogus group information in
the registry.  For example, I did a gnus-summary-refer-article from 
the group
"[email-masked]:[email-masked]"
and the registry ended up containing
"nntp+Gmane:[email-masked]" as the group name when it
should have been "nntp+Gmane:gmane.emacs.devel".

The enclosed patch addresses this problem.

>From 5d67e61ef4310565329047a3accad3fa3192ef7a Mon Sep 17 00:00:00 2001
From: Dave Abrahams <[email-masked]>
Date: Sun, 19 Aug 2012 22:17:33 -0400
Subject: [PATCH] gnus-request-head: when gnus-override-method is set, allow
 the backend `request-head' function to determine the group
 name on its own.

Without this fix you can end up with some bogus group name that has
nothing to do with the select method actually used.
---
 lisp/gnus-int.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/gnus-int.el b/lisp/gnus-int.el
index 3aee7c6..bc3ba18 100644
--- a/lisp/gnus-int.el
+++ b/lisp/gnus-int.el
@@ -599,7 +599,8 @@ real group. Does nothing on a real group."
 	    clean-up t))
      ;; Use `head' function.
      ((fboundp head)
-      (setq res (funcall head article (gnus-group-real-name group)
+      (setq res (funcall head article
+                         (and (not gnus-override-method) (gnus-group-real-name group))
 			 (nth 1 gnus-command-method))))
      ;; Use `article' function.
      (t
-- 
1.7.7.5 (Apple Git-26)

Ma Gnus v0.6
GNU Emacs 24.1.1 (x86_64-apple-darwin11.4.0, Carbon Version 1.6.0 AppKit 1138.47)
 of 2012-06-27 on pluto.luannocracy.com
200 news.gmane.org InterNetNews NNRP server INN 2.5.1 ready (posting ok)
101 Capability list:
VERSION 2
IMPLEMENTATION INN 2.5.1
AUTHINFO USER
HDR
LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
OVER
POST
READER
STARTTLS
.
382 Begin TLS negotiation now
101 Capability list:
VERSION 2
IMPLEMENTATION INN 2.5.1
AUTHINFO USER
HDR
LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
OVER
POST
READER
.

-- 
Dave Abrahams
BoostPro Computing                  Software Development        Training
http://www.boostpro.com             Clang/LLVM/EDG Compilers  C++  Boost