Subject: bug#38011: 27.0.50; [PATCH] WIP on allowing Gnus backends to return header data directly

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 30 Apr 2020 06:50:34 +0200

Eric Abrahamsen <[email-masked]> writes:

> Can someone explain what exactly this function is supposed to do?

Somebody should have written more comments when they wrote that...  and,
like, made it correct.

It transforms this:

64007	Formatting labels used for URL buttons in Gnus articles	Narendra Joshi <[email-masked]>	Sun, 19 Apr 2020 00:31:13 +0200	<[email-masked]>	<[email-masked]>	3614	14	Xref: reader01.eternal-september.org gnu.emacs.help:57603

Into this:

64007	Formatting labels used for URL buttons in Gnus articles	Narendra Joshi <[email-masked]>	Sun, 19 Apr 2020 00:31:13 +0200	<[email-masked]>	<[email-masked]>	3614	14	Xref: marnie gnu.emacs.help:57603 01.eternal-september.org 

Which is wrong, of course -- the "01.eternal-september.org" thing
shouldn't be there.

Anyway, what it's supposed to do it rewrite

Xref: reader01.eternal-september.org foo.bar:2523 gnu.emacs.help:57603 zot.bar:3242

to

Xref: whatever gnu.emacs.help:57603 foo.bar:2523 zot.bar:3242

That is, put the group/article we're really selecting first in the Xref
header, but leave the remaining as they were.  This is because we need
those to mark the article as read in those other groups, but we
primarily need to know where this article really came from (the first
entry).

Feel free to adapt this to comments in the code.  :-)  And rewrite to be
correct.  I don't understand why it's doing all the regexp stuff
(wrongly) in the first place -- it should just split the data into a
list and then do its work...

Perhaps it was marginally faster to do it this way?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no