From: Simon Josefsson <jas@extundo.com>
Cc: ding@gnus.org
Subject: Re: wrong-type-argument exiting nnml group
Date: Sat, 15 Sep 2001 23:20:18 +0200 [thread overview]
Message-ID: <iluwv308831.fsf@barbar.josefsson.org> (raw)
In-Reply-To: <87pu8sxjeo.fsf@harpo.homeip.net> (Samuel Padgett's message of "Sat, 15 Sep 2001 16:56:31 -0400")
Samuel Padgett <spadgett1@nc.rr.com> writes:
> Simon Josefsson <jas@extundo.com> writes:
>
>> Samuel Padgett <spadgett1@nc.rr.com> 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 <jas@extundo.com>
* 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))
next prev parent reply other threads:[~2001-09-15 21:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-15 17:14 Samuel Padgett
2001-09-15 17:58 ` Simon Josefsson
2001-09-15 18:58 ` Samuel Padgett
2001-09-15 19:48 ` Simon Josefsson
2001-09-15 20:56 ` Samuel Padgett
2001-09-15 21:20 ` Simon Josefsson [this message]
2001-09-15 22:03 ` Samuel Padgett
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=iluwv308831.fsf@barbar.josefsson.org \
--to=jas@extundo.com \
--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).