From: Alex Schroeder Date: Mon, 16 Jan 2006 17:50:30 +0000 (+0000) Subject: (unrmail): Use regular expression search to find X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=56688276b28ecd93f5e03f75f906f877142a5334;p=emacs.git (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. --- diff --git a/lisp/mail/ChangeLog b/lisp/mail/ChangeLog index be5652e492e..9ca05486fe6 100644 --- a/lisp/mail/ChangeLog +++ b/lisp/mail/ChangeLog @@ -1,3 +1,10 @@ +2006-01-16 Alex Schroeder + + * unrmail.el (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. + 2006-01-16 Henrik Enberg * rmail.el: Don't require `rmailout' and `rmailsum'. diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index d1e95a41244..a4ba36622eb 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -108,11 +108,12 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (from-buffer (current-buffer))) ;; Process the messages one by one. - (while (search-forward "\^_\^l" nil t) + (while (re-search-forward "^\^_\^l" nil t) (let ((beg (point)) (end (save-excursion - (if (search-forward "\^_" nil t) - (1- (point)) (point-max)))) + (if (re-search-forward "^\^_\\(\^l\\|\\'\\)" nil t) + (match-beginning 0) + (point-max)))) (coding 'raw-text) label-line attrs keywords mail-from reformatted) @@ -173,6 +174,12 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (re-search-forward "^[*][*][*] EOOH [*][*][*]\n") (delete-region (point-min) (point))) + ;; Handle rmime formatting. + (when (require 'rmime nil t) + (let ((start (point))) + (while (search-forward rmime-magic-string nil t)) + (delete-region start (point)))) + ;; Some operations on the message header itself. (goto-char (point-min)) (save-restriction