comparison lisp/mail/undigest.el @ 83653:2a69b973fae2

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 852-856) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 93-96) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 245) - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-32
author Miles Bader <miles@gnu.org>
date Tue, 21 Aug 2007 04:55:30 +0000
parents ce34261da54f
children de499b20517a 4aedd218aad1 aaccdab0ee26
comparison
equal deleted inserted replaced
83652:5b644ae74c91 83653:2a69b973fae2
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