Gnus development mailing list
 help / color / mirror / Atom feed
* Comments in References
@ 2008-09-24 11:44 Andreas Schwab
  2008-09-24 17:00 ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2008-09-24 11:44 UTC (permalink / raw)
  To: ding

The References header can contain CFWS, but Gnus cannot cope.  For
example, when trying to fetch the parent of
<1222245299.18015.60.camel@johannes.berg> in
gmane.linux.kernel.wireless.general Gnus says it cannot fetch article
<1222242040.4183.1.camel@localhost>(sfid-20080924_094114_025986_BB83E1CF)>,
and in a thread view the message is shown as an orphan.

Should gnus-parent-id strip comments, or is this the duty of its
callers?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

* Re: Comments in References
  2008-09-24 11:44 Comments in References Andreas Schwab
@ 2008-09-24 17:00 ` Reiner Steib
  2008-09-24 18:49   ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-09-24 17:00 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: ding

On Wed, Sep 24 2008, Andreas Schwab wrote:

> The References header can contain CFWS, but Gnus cannot cope.  For
> example, when trying to fetch the parent of
> <1222245299.18015.60.camel@johannes.berg> in
> gmane.linux.kernel.wireless.general Gnus says it cannot fetch article
> <1222242040.4183.1.camel@localhost>(sfid-20080924_094114_025986_BB83E1CF)>,
> and in a thread view the message is shown as an orphan.
>
> Should gnus-parent-id strip comments, or is this the duty of its
> callers?

According to it's doc string, I'd say `gnus-parent-id' should strip
it:

,----[ <f1> f gnus-parent-id RET ]
| gnus-parent-id is a Lisp function in `gnus-util.el'.
| (gnus-parent-id REFERENCES &optional N)
| 
| Return the last Message-ID in REFERENCES.
| If N, return the Nth ancestor instead.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Comments in References
  2008-09-24 17:00 ` Reiner Steib
@ 2008-09-24 18:49   ` Andreas Schwab
  2008-09-24 20:16     ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2008-09-24 18:49 UTC (permalink / raw)
  To: ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Wed, Sep 24 2008, Andreas Schwab wrote:
>
>> Should gnus-parent-id strip comments, or is this the duty of its
>> callers?
>
> According to it's doc string, I'd say `gnus-parent-id' should strip
> it:
>
> ,----[ <f1> f gnus-parent-id RET ]
> | gnus-parent-id is a Lisp function in `gnus-util.el'.
> | (gnus-parent-id REFERENCES &optional N)
> | 
> | Return the last Message-ID in REFERENCES.
> | If N, return the Nth ancestor instead.
> `----

What about this then?  I've tested it with
gmane.linux.kernel.wireless.general, the false orphans are now correctly
threaded.

Andreas.

2008-09-24  Andreas Schwab  <schwab@suse.de>

	* gnus-util.el (gnus-split-references): Strip comments.
	(gnus-parent-id): Likewise.

Index: gnus-util.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-util.el,v
retrieving revision 7.84
diff -u -a -p -r7.84 gnus-util.el
--- gnus-util.el	27 Jul 2008 00:26:58 -0000	7.84
+++ gnus-util.el	24 Sep 2008 18:45:22 -0000
@@ -625,7 +625,7 @@ ARGS are passed to `message'."
 (defun gnus-split-references (references)
   "Return a list of Message-IDs in REFERENCES."
   (let ((beg 0)
-	(references (or references ""))
+	(references (mail-header-remove-comments (or references "")))
 	ids)
     (while (string-match "<[^<]+[^< \t]" references beg)
       (push (substring references (match-beginning 0) (setq beg (match-end 0)))
@@ -652,8 +652,9 @@ If N, return the Nth ancestor instead."
 	  (while (nthcdr n ids)
 	    (setq ids (cdr ids)))
 	  (car ids))
-      (when (string-match "\\(<[^<]+>\\)[ \t]*\\'" references)
-	(match-string 1 references)))))
+      (let ((references (mail-header-remove-comments references)))
+	(when (string-match "\\(<[^<]+>\\)[ \t]*\\'" references)
+	  (match-string 1 references))))))
 
 (defun gnus-buffer-live-p (buffer)
   "Say whether BUFFER is alive or not."

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

* Re: Comments in References
  2008-09-24 18:49   ` Andreas Schwab
@ 2008-09-24 20:16     ` Reiner Steib
  2008-09-26  7:22       ` Bjørn Mork
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-09-24 20:16 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: ding

On Wed, Sep 24 2008, Andreas Schwab wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> On Wed, Sep 24 2008, Andreas Schwab wrote:
>>> Should gnus-parent-id strip comments, or is this the duty of its
>>> callers?
>>
>> According to it's doc string, I'd say `gnus-parent-id' should strip
>> it: [...]
> What about this then?  I've tested it with
> gmane.linux.kernel.wireless.general, the false orphans are now correctly
> threaded.
[...]
> 	* gnus-util.el (gnus-split-references): Strip comments.
> 	(gnus-parent-id): Likewise.

Looks good, thank.  Unless someone points out a problem (within ~1
day), please install[1] it.  I'd say there is no doubt that this
qualifies as a bug fix (I assume you verified that the RFCs allow
CFWS).

Bye, Reiner.

[1] AFAIK you don't have write access to cvs.gnus.org.  So install it
    in Emacs CVS.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Comments in References
  2008-09-24 20:16     ` Reiner Steib
@ 2008-09-26  7:22       ` Bjørn Mork
  2008-09-27  8:12         ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Bjørn Mork @ 2008-09-26  7:22 UTC (permalink / raw)
  To: ding

Reiner Steib <reinersteib+gmane@imap.cc> writes:
> On Wed, Sep 24 2008, Andreas Schwab wrote:
>> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>>> On Wed, Sep 24 2008, Andreas Schwab wrote:
>>>> Should gnus-parent-id strip comments, or is this the duty of its
>>>> callers?
>>>
>>> According to it's doc string, I'd say `gnus-parent-id' should strip
>>> it: [...]
>> What about this then?  I've tested it with
>> gmane.linux.kernel.wireless.general, the false orphans are now correctly
>> threaded.
> [...]
>> 	* gnus-util.el (gnus-split-references): Strip comments.
>> 	(gnus-parent-id): Likewise.
>
> Looks good, thank.  Unless someone points out a problem (within ~1
> day), please install[1] it.  I'd say there is no doubt that this
> qualifies as a bug fix (I assume you verified that the RFCs allow
> CFWS).

RFC2822 does allow CFWS before and after a message-id. Quote from
section "3.6.4. Identification fields":


   The message identifier (msg-id) is similar in syntax to an angle-addr
   construct without the internal CFWS.

     message-id      =       "Message-ID:" msg-id CRLF

     in-reply-to     =       "In-Reply-To:" 1*msg-id CRLF

     references      =       "References:" 1*msg-id CRLF

     msg-id          =       [CFWS] "<" id-left "@" id-right ">" [CFWS]



Note that RFC2822 defines the CFWS as part of the msg-id, which IMHO
implies that the gnus-parent-id help text isn't really clear wrt
stripping comments.  Maybe the documentation should be updated to
clearify this?


Bjørn
-- 
Your subtlety reminds me of a sexual fantasy




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

* Re: Comments in References
  2008-09-26  7:22       ` Bjørn Mork
@ 2008-09-27  8:12         ` Andreas Schwab
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2008-09-27  8:12 UTC (permalink / raw)
  To: ding

Bjørn Mork <bmork@dod.no> writes:

> Note that RFC2822 defines the CFWS as part of the msg-id, which IMHO
> implies that the gnus-parent-id help text isn't really clear wrt
> stripping comments.

Since runs of FWS, comment or CFWS are semantically equivalent to a
single space it seems obvious that they are supposed to be ignored
during parsing.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

end of thread, other threads:[~2008-09-27  8:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-24 11:44 Comments in References Andreas Schwab
2008-09-24 17:00 ` Reiner Steib
2008-09-24 18:49   ` Andreas Schwab
2008-09-24 20:16     ` Reiner Steib
2008-09-26  7:22       ` Bjørn Mork
2008-09-27  8:12         ` Andreas Schwab

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