From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/38781 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: wrong-type-argument exiting nnml group Date: Sat, 15 Sep 2001 23:20:18 +0200 Message-ID: References: <87g09oz88k.fsf@harpo.homeip.net> <87u1y4xovs.fsf@harpo.homeip.net> <87pu8sxjeo.fsf@harpo.homeip.net> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035174589 24289 80.91.224.250 (21 Oct 2002 04:29:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:29:49 +0000 (UTC) Cc: ding@gnus.org Return-Path: Return-Path: Original-Received: (qmail 2448 invoked from network); 15 Sep 2001 21:20:23 -0000 Original-Received: from dolk.extundo.com (195.42.214.242) by gnus.org with SMTP; 15 Sep 2001 21:20:23 -0000 Original-Received: from barbar.josefsson.org (slipsten.extundo.com [195.42.214.241]) (authenticated bits=0) by dolk.extundo.com (8.12.0/8.12.0) with ESMTP id f8FLKU0r015710; Sat, 15 Sep 2001 23:20:30 +0200 Original-To: Samuel Padgett In-Reply-To: <87pu8sxjeo.fsf@harpo.homeip.net> (Samuel Padgett's message of "Sat, 15 Sep 2001 16:56:31 -0400") Mail-Copies-To: nobody User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.105 Original-Lines: 74 Xref: main.gmane.org gmane.emacs.gnus.general:38781 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:38781 Samuel Padgett writes: > Simon Josefsson writes: > >> Samuel Padgett writes: >> >>> Hm. Looking at it after nnml-generate-nov-databases, I see that there >>> is a ^M after each header field for article 1. Could this have caused >>> the problem? >> >> Yes. I do not understand how that happens though, even if the article >> in question uses CRLF the NOV parsing routine isn't fooled, at least >> for me. > > I looked at the article more closely and noticed it has mixed line > endings. The first four lines end with just a LF, whereas the rest > end with CRLF. Ouch. Nnml articles should have LF line endings. Can you find out how this happened? Anyway, I committed the following to make nnml a little bit more robust about these kind of errors. You should be able to M-x nnml-generate-nov-databases RET and having things work now. 2001-09-15 Simon Josefsson * nnml.el (nnml-parse-head): Handle CRLF files. (nnml-generate-nov-file): Ditto. (nnml-retrieve-headers): Ditto. Index: nnml.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnml.el,v retrieving revision 6.25 diff -u -u -w -u -w -r6.25 nnml.el --- nnml.el 2001/09/08 20:55:16 6.25 +++ nnml.el 2001/09/15 21:17:19 @@ -157,7 +157,7 @@ (setq beg (point)) (nnheader-insert-head file) (goto-char beg) - (if (search-forward "\n\n" nil t) + (if (re-search-forward "\n\r?\n" nil t) (forward-char -1) (goto-char (point-max)) (insert "\n\n")) @@ -713,13 +713,15 @@ (unless (zerop (buffer-size)) (narrow-to-region (goto-char (point-min)) - (if (search-forward "\n\n" nil t) (1- (point)) (point-max)))) + (if (re-search-forward "\n\r?\n" nil t) (1- (point)) (point-max)))) ;; Fold continuation lines. (goto-char (point-min)) (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t) (replace-match " " t t)) ;; Remove any tabs; they are too confusing. (subst-char-in-region (point-min) (point-max) ?\t ? ) + ;; Remove any ^M's; they are too confusing. + (subst-char-in-region (point-min) (point-max) ?\r ? ) (let ((headers (nnheader-parse-head t))) (mail-header-set-chars headers chars) (mail-header-set-number headers number) @@ -838,7 +840,7 @@ (narrow-to-region (goto-char (point-min)) (progn - (search-forward "\n\n" nil t) + (re-search-forward "\n\r?\n" nil t) (setq chars (- (point-max) (point))) (max 1 (1- (point))))) (unless (zerop (buffer-size))