Mercurial > emacs
comparison lisp/mail/unrmail.el @ 88161:6e97bfe9f7f0
(unrmail): Use regular expression search to find
message separators such that the fake separators inserted by
rmime.el are not matched. The sections added by rmime.el are
removed.
author | Alex Schroeder <alex@gnu.org> |
---|---|
date | Mon, 16 Jan 2006 17:50:18 +0000 |
parents | d7ddb3e565de |
children |
comparison
equal
deleted
inserted
replaced
88160:a271a865e911 | 88161:6e97bfe9f7f0 |
---|---|
106 | 106 |
107 (let ((temp-buffer (get-buffer-create " unrmail")) | 107 (let ((temp-buffer (get-buffer-create " unrmail")) |
108 (from-buffer (current-buffer))) | 108 (from-buffer (current-buffer))) |
109 | 109 |
110 ;; Process the messages one by one. | 110 ;; Process the messages one by one. |
111 (while (search-forward "\^_\^l" nil t) | 111 (while (re-search-forward "^\^_\^l" nil t) |
112 (let ((beg (point)) | 112 (let ((beg (point)) |
113 (end (save-excursion | 113 (end (save-excursion |
114 (if (search-forward "\^_" nil t) | 114 (if (re-search-forward "^\^_\\(\^l\\|\\'\\)" nil t) |
115 (1- (point)) (point-max)))) | 115 (match-beginning 0) |
116 (point-max)))) | |
116 (coding 'raw-text) | 117 (coding 'raw-text) |
117 label-line attrs keywords | 118 label-line attrs keywords |
118 mail-from reformatted) | 119 mail-from reformatted) |
119 (with-current-buffer temp-buffer | 120 (with-current-buffer temp-buffer |
120 (setq buffer-undo-list t) | 121 (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) |