Gnus development mailing list
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: ding@gnus.org
Subject: Re: Comments in References
Date: Wed, 24 Sep 2008 20:49:22 +0200	[thread overview]
Message-ID: <m24p45idl9.fsf@igel.home> (raw)
In-Reply-To: <87hc85qy0z.fsf@marauder.physik.uni-ulm.de>

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




  reply	other threads:[~2008-09-24 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24 11:44 Andreas Schwab
2008-09-24 17:00 ` Reiner Steib
2008-09-24 18:49   ` Andreas Schwab [this message]
2008-09-24 20:16     ` Reiner Steib
2008-09-26  7:22       ` Bjørn Mork
2008-09-27  8:12         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24p45idl9.fsf@igel.home \
    --to=schwab@suse.de \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).