* Re: gnus-alter-header-function and mail->news gateway.
2003-03-07 1:24 ` gnus-alter-header-function and mail->news gateway Jesper Harder
@ 2003-03-07 19:10 ` Gaute B Strokkenes
0 siblings, 0 replies; 2+ messages in thread
From: Gaute B Strokkenes @ 2003-03-07 19:10 UTC (permalink / raw)
On Fri, 07 Mar 2003, harder@myrealbox.com wrote:
> Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>
>> I read a mailing list through a news gateway. Threading does not
>> work very well, since the gateway munges the headers slightly. For
>> instance, "References:" becomes "X-Originial-References:". I would
>> like to have Gnus consider this information as well, and it seems
>> that I can do so using gnus-alter-header-function.
>
> This function won't do the trick -- it can only alter a header
> _value_ not the name of a header.
Bummer.
> Another more serious problem is that Gnus doesn't know the the value
> of 'X-Originial-References' when the threading is done.
>
> Initially, just the subset of headers included in the overview are
> fetched. The rest of the headers are only fetched from the server
> when you actually view the article.
>
> You _can_ tell Gnus to fetch all headers, but this will be _much_
> slower than the normal method.
>
> Something like this might work:
>
> (defun my-unmangle-references ()
> (save-excursion
> (goto-char (point-min))
> (when (re-search-forward "^X-Original-References:" nil t)
> (replace-match "References:"))))
>
> (add-hook 'gnus-parse-headers-hook 'my-unmangle-references)
> (setq nntp-server-xover nil)
Thanks--this almost works, and doesn't seem to be unbearably slow.
However, it seems (as determined by inserting calls to message in
strategic places) that the function is only ever called once for all
of the headers, and so only one article ever gets its references
fixed.
Also, is there a way to set things up so that the hook is only used
for a particular group, and that xover is used for other groups?
--
Gaute Strokkenes http://www.srcf.ucam.org/~gs234/
The appreciation of the average visual graphisticator alone is worth
the whole suaveness and decadence which abounds!!
^ permalink raw reply [flat|nested] 2+ messages in thread