Gnus development mailing list
 help / color / mirror / Atom feed
* carriage-returns and nnimap
@ 2010-12-17 12:58 Andrew Cohen
  2010-12-17 14:09 ` Ted Zlatanov
  2010-12-17 16:16 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Cohen @ 2010-12-17 12:58 UTC (permalink / raw)
  To: ding

I had noticed that gnus-registry-split-fancy-with-parent had stopped
working with "sender" splitting. I finally decided to track this down.

Looking at the registry I noticed that the "sender" and "subject" fields
(and some others) had a spurious space at the end of them (which is
wrong), while an old copy of the registry (from months ago) has no such
spaces (which is right). I can't pinpoint exactly when this changed so
I'm not sure of the exact cause.

Tracing this a bit I found that 'gnus-get-newsgroup-headers translates
\r into spaces, so I suspect that this is where the extra spaces are
coming from. I added a call to 'nnheader-remove-cr-followed-by-lf in
'gnus-get-newsgroup-headers just before the \r->space translation and it
seems to fix the problem. 

I didn't want to just push this in case I've missed something. The whole
carriage-return thing in nnimap confuses me.

Regards,
Andy


diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index ceaa014..dbd25ca 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -6262,6 +6262,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
                               gnus-newsgroup-ignored-charsets)))
     (with-current-buffer nntp-server-buffer
       ;; Translate all TAB characters into SPACE characters.
+      (nnheader-remove-cr-followed-by-lf)
       (subst-char-in-region (point-min) (point-max) ?\t ?  t)
       (subst-char-in-region (point-min) (point-max) ?\r ?  t)
       (ietf-drums-unfold-fws)




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: carriage-returns and nnimap
  2010-12-17 12:58 carriage-returns and nnimap Andrew Cohen
@ 2010-12-17 14:09 ` Ted Zlatanov
  2010-12-17 14:18   ` Andrew Cohen
  2010-12-17 16:16 ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 8+ messages in thread
From: Ted Zlatanov @ 2010-12-17 14:09 UTC (permalink / raw)
  To: ding

On Fri, 17 Dec 2010 07:58:29 -0500 Andrew Cohen <cohen@andy.bu.edu> wrote: 

AC> I had noticed that gnus-registry-split-fancy-with-parent had stopped
AC> working with "sender" splitting. I finally decided to track this down.

AC> Looking at the registry I noticed that the "sender" and "subject" fields
AC> (and some others) had a spurious space at the end of them (which is
AC> wrong), while an old copy of the registry (from months ago) has no such
AC> spaces (which is right). I can't pinpoint exactly when this changed so
AC> I'm not sure of the exact cause.

AC> Tracing this a bit I found that 'gnus-get-newsgroup-headers translates
AC> \r into spaces, so I suspect that this is where the extra spaces are
AC> coming from. I added a call to 'nnheader-remove-cr-followed-by-lf in
AC> 'gnus-get-newsgroup-headers just before the \r->space translation and it
AC> seems to fix the problem. 

AC> I didn't want to just push this in case I've missed something. The whole
AC> carriage-return thing in nnimap confuses me.

I hadn't noticed, thanks for catching that.

I think your fix is correct, but if necessary I can always adjust
gnus-registry.el alone to trim those extra CRs.

Ted




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: carriage-returns and nnimap
  2010-12-17 14:09 ` Ted Zlatanov
@ 2010-12-17 14:18   ` Andrew Cohen
  2010-12-17 15:36     ` Ted Zlatanov
  2010-12-17 16:17     ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Cohen @ 2010-12-17 14:18 UTC (permalink / raw)
  To: ding

>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

    Ted> On Fri, 17 Dec 2010 07:58:29 -0500 Andrew Cohen <cohen@andy.bu.edu> wrote:

[...]


    AC> I didn't want to just push this in case I've missed
    AC> something. The whole carriage-return thing in nnimap confuses
    AC> me.

    Ted> I hadn't noticed, thanks for catching that.

    Ted> I think your fix is correct, but if necessary I can always
    Ted> adjust gnus-registry.el alone to trim those extra CRs.

I'm becoming more confident that the header parsing routine should
remove them. I wonder why we have two nearly (but not quite) identical
parsing routines. One is inside 'gnus-get-newsgroup-headers, while the
other is 'nnheader-parse-naked-head. The latter one includes the CR
removal, so I suspect the former should as well.

I'll push this shortly unless I hear something.

Best,
Andy




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: carriage-returns and nnimap
  2010-12-17 14:18   ` Andrew Cohen
@ 2010-12-17 15:36     ` Ted Zlatanov
  2010-12-17 16:17     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Ted Zlatanov @ 2010-12-17 15:36 UTC (permalink / raw)
  To: ding

On Fri, 17 Dec 2010 09:18:17 -0500 Andrew Cohen <cohen@andy.bu.edu> wrote: 

AC> I wonder why we have two nearly (but not quite) identical parsing
AC> routines. One is inside 'gnus-get-newsgroup-headers, while the other
AC> is 'nnheader-parse-naked-head. The latter one includes the CR
AC> removal, so I suspect the former should as well.

I don't know why, but we should get rid of one of the two, probably the
former.

Ted




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: carriage-returns and nnimap
  2010-12-17 12:58 carriage-returns and nnimap Andrew Cohen
  2010-12-17 14:09 ` Ted Zlatanov
@ 2010-12-17 16:16 ` Lars Magne Ingebrigtsen
  2010-12-17 16:25   ` Andrew Cohen
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-12-17 16:16 UTC (permalink / raw)
  To: ding

Andrew Cohen <cohen@andy.bu.edu> writes:

> Tracing this a bit I found that 'gnus-get-newsgroup-headers translates
> \r into spaces, so I suspect that this is where the extra spaces are
> coming from. I added a call to 'nnheader-remove-cr-followed-by-lf in
> 'gnus-get-newsgroup-headers just before the \r->space translation and it
> seems to fix the problem. 

There should be no \r\n in the buffers when Gnus gets them.  The backend
should do \r\n decoding if the transport it uses uses \r\n...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: carriage-returns and nnimap
  2010-12-17 14:18   ` Andrew Cohen
  2010-12-17 15:36     ` Ted Zlatanov
@ 2010-12-17 16:17     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-12-17 16:17 UTC (permalink / raw)
  To: ding

Andrew Cohen <cohen@andy.bu.edu> writes:

> I'm becoming more confident that the header parsing routine should
> remove them. I wonder why we have two nearly (but not quite) identical
> parsing routines. One is inside 'gnus-get-newsgroup-headers, while the
> other is 'nnheader-parse-naked-head. The latter one includes the CR
> removal, so I suspect the former should as well.

The former is a Gnus function which does threading etc etc while
parsing.  The latter is a general convenience function used by any
backends that need to do ad-hoc parsing for some reason or other.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: carriage-returns and nnimap
  2010-12-17 16:16 ` Lars Magne Ingebrigtsen
@ 2010-12-17 16:25   ` Andrew Cohen
  2010-12-17 16:33     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cohen @ 2010-12-17 16:25 UTC (permalink / raw)
  To: ding

>>>>> "Lars" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

    Lars> Andrew Cohen <cohen@andy.bu.edu> writes:
    >> Tracing this a bit I found that 'gnus-get-newsgroup-headers
    >> translates \r into spaces, so I suspect that this is where the
    >> extra spaces are coming from. I added a call to
    >> 'nnheader-remove-cr-followed-by-lf in 'gnus-get-newsgroup-headers
    >> just before the \r->space translation and it seems to fix the
    >> problem.

    Lars> There should be no \r\n in the buffers when Gnus gets them.
    Lars> The backend should do \r\n decoding if the transport it uses
    Lars> uses \r\n...

OK, so this should be a change in 'nnimap-retrieve-headers? Maybe added
to 'nnimap-transform-headers?




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: carriage-returns and nnimap
  2010-12-17 16:25   ` Andrew Cohen
@ 2010-12-17 16:33     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-12-17 16:33 UTC (permalink / raw)
  To: ding

Andrew Cohen <cohen@andy.bu.edu> writes:

> OK, so this should be a change in 'nnimap-retrieve-headers? Maybe added
> to 'nnimap-transform-headers?

Yup.  I've now done so.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-12-17 16:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-17 12:58 carriage-returns and nnimap Andrew Cohen
2010-12-17 14:09 ` Ted Zlatanov
2010-12-17 14:18   ` Andrew Cohen
2010-12-17 15:36     ` Ted Zlatanov
2010-12-17 16:17     ` Lars Magne Ingebrigtsen
2010-12-17 16:16 ` Lars Magne Ingebrigtsen
2010-12-17 16:25   ` Andrew Cohen
2010-12-17 16:33     ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).