comparison lisp/mail/undigest.el @ 78558:ce34261da54f

(rmail-digest-parse-rfc1153sloppy): Be even sloppier, for the sake of GNU Mailman. (rmail-digest-rfc1153): Initialize `result' correctly.
author Glenn Morris <rgm@gnu.org>
date Wed, 15 Aug 2007 03:09:52 +0000
parents 8e27d63c45eb
children de499b20517a 4aedd218aad1 aaccdab0ee26
comparison
equal deleted inserted replaced
78557:7f509b9f0ead 78558:ce34261da54f
91 "Parse using the method defined in RFC 1153, allowing for some sloppiness. 91 "Parse using the method defined in RFC 1153, allowing for some sloppiness.
92 See rmail-digest-methods." 92 See rmail-digest-methods."
93 (rmail-digest-rfc1153 93 (rmail-digest-rfc1153
94 "^-\\{55,\\}\n\n" 94 "^-\\{55,\\}\n\n"
95 "^\n-\\{27,\\}\n\n" 95 "^\n-\\{27,\\}\n\n"
96 "^\n-\\{27,\\}\n\nEnd of")) 96 ;; GNU Mailman knowingly (see comment at line 353 of ToDigest.py in
97 ;; Mailman source) produces non-conformant rfc 1153 digests, in that
98 ;; the trailer contains a "digest footer" like this:
99 ;; _______________________________________________
100 ;; <one or more lines of list blurb>
101 ;;
102 ;; End of Foo Digest...
103 ;; **************************************
104 "^\nEnd of"))
97 105
98 (defun rmail-digest-rfc1153 (prolog-sep message-sep trailer-sep) 106 (defun rmail-digest-rfc1153 (prolog-sep message-sep trailer-sep)
99 (goto-char (point-min)) 107 (goto-char (point-min))
100 (when (re-search-forward prolog-sep nil t) 108 (when (re-search-forward prolog-sep nil t)
101 ;; Ok, prolog separator found 109 ;; Ok, prolog separator found
102 (let ((start (make-marker)) 110 (let ((start (make-marker))
103 (end (make-marker)) 111 (end (make-marker))
104 separator result) 112 separator result)
105 (move-marker start (match-beginning 0)) 113 (move-marker start (match-beginning 0))
106 (move-marker end (match-end 0)) 114 (move-marker end (match-end 0))
107 (setq result (cons (copy-marker start) (copy-marker end t))) 115 (setq result (list (cons (copy-marker start) (copy-marker end t))))
108 (when (re-search-forward message-sep nil t) 116 (when (re-search-forward message-sep nil t)
109 ;; Ok, at least one message separator found 117 ;; Ok, at least one message separator found
110 (setq separator (match-string 0)) 118 (setq separator (match-string 0))
111 (when (re-search-forward trailer-sep nil t) 119 (when (re-search-forward trailer-sep nil t)
112 ;; Wonderful, we found a trailer, too. Now, go on splitting 120 ;; Wonderful, we found a trailer, too. Now, go on splitting