comparison lisp/mail/unrmail.el @ 101839:1eedc742bd61

Sync final change from rmail-mox-branch, rev 1.13.2.4, 2006-01-16. Alex Schroeder <alex at gnu.org> (unrmail): Use regexps to find message separators so as not to match any fake rmime.el separators. Remove any sections added by rmime.el.
author Glenn Morris <rgm@gnu.org>
date Sat, 07 Feb 2009 03:01:59 +0000
parents 6babeadc07c9
children a67721ab1564
comparison
equal deleted inserted replaced
101838:a4a5037b3040 101839:1eedc742bd61
105 105
106 (let ((temp-buffer (get-buffer-create " unrmail")) 106 (let ((temp-buffer (get-buffer-create " unrmail"))
107 (from-buffer (current-buffer))) 107 (from-buffer (current-buffer)))
108 108
109 ;; Process the messages one by one. 109 ;; Process the messages one by one.
110 (while (search-forward "\^_\^l" nil t) 110 (while (re-search-forward "^\^_\^l" nil t)
111 (let ((beg (point)) 111 (let ((beg (point))
112 (end (save-excursion 112 (end (save-excursion
113 (if (search-forward "\^_" nil t) 113 (if (re-search-forward "^\^_\\(\^l\\|\\'\\)" nil t)
114 (1- (point)) (point-max)))) 114 (match-beginning 0)
115 (point-max))))
115 (coding 'raw-text) 116 (coding 'raw-text)
116 label-line attrs keywords 117 label-line attrs keywords
117 mail-from reformatted) 118 mail-from reformatted)
118 (with-current-buffer temp-buffer 119 (with-current-buffer temp-buffer
119 (setq buffer-undo-list t) 120 (setq buffer-undo-list t)
171 ;; Not reformatted. Delete the special 172 ;; Not reformatted. Delete the special
172 ;; lines before the real header. 173 ;; lines before the real header.
173 (re-search-forward "^[*][*][*] EOOH [*][*][*]\n") 174 (re-search-forward "^[*][*][*] EOOH [*][*][*]\n")
174 (delete-region (point-min) (point))) 175 (delete-region (point-min) (point)))
175 176
177 ;; Handle rmime formatting.
178 (when (require 'rmime nil t)
179 (let ((start (point)))
180 (while (search-forward rmime-magic-string nil t))
181 (delete-region start (point))))
182
176 ;; Some operations on the message header itself. 183 ;; Some operations on the message header itself.
177 (goto-char (point-min)) 184 (goto-char (point-min))
178 (save-restriction 185 (save-restriction
179 (narrow-to-region 186 (narrow-to-region
180 (point-min) 187 (point-min)