Synch to No Gnus 200409231508.
[elisp/gnus.git-] / lisp / nnheader.el
index 1b81916..141fce0 100644 (file)
@@ -1,7 +1,7 @@
 ;;; nnheader.el --- header access macros for Semi-gnus and its backends
 
 ;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996,
-;;        1997, 1998, 2000, 2001, 2002, 2003
+;;        1997, 1998, 2000, 2001, 2002, 2003, 2004
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -67,7 +67,7 @@ they will keep on jabbering all the time."
   :group 'gnus-server
   :type 'boolean)
 
-(defvar nnheader-max-head-length 4096
+(defvar nnheader-max-head-length 8192
   "*Max length of the head of articles.
 
 Value is an integer, nil, or t.  nil means read in chunks of a file
@@ -788,15 +788,22 @@ given, the return value will not contain the last newline."
               out)))
      out))
 
+(defvar nnheader-uniquify-message-id nil)
+
 (defmacro nnheader-nov-read-message-id (&optional number)
-  '(let ((id (nnheader-nov-field)))
+  `(let ((id (nnheader-nov-field)))
      (if (string-match "^<[^>]+>$" id)
-        id
-       (nnheader-generate-fake-message-id number))))
+        ,(if nnheader-uniquify-message-id
+             `(if (string-match "__[^@]+@" id)
+                  (concat (substring id 0 (match-beginning 0))
+                          (substring id (1- (match-end 0))))
+                id)
+           'id)
+       (nnheader-generate-fake-message-id ,number))))
 
 (defun nnheader-parse-nov ()
-  (let ((eol (point-at-eol))
-       (number (nnheader-nov-read-integer)))
+  (let* ((eol (point-at-eol))
+        (number (nnheader-nov-read-integer)))
     (make-full-mail-header
      number                            ; number
      (nnheader-nov-field)              ; subject