Dmitry Yaitskov <dimas(a)home.com> wrote:
<snip-snip>
Oops. Sorry about the followup to my own post. Here is a somewhat
better variant:
----------------------------cut here-------------------------------
--- e:\bin\XEmacs\xemacs-packages\lisp\mail-lib\pop3.el Mon Mar 08 22:36:12 1999
+++ pop3.el Mon Mar 29 15:22:04 1999
@@ -310,12 +310,18 @@
(defun pop3-clean-region (start end)
"Convert MS-DOG style line endings to normal line endings.
-Also remove '.' from the beginning of lines."
+Also remove '.' from the beginning of lines.
+Also escape 'From ' at the beginning of lines with '>'."
(setq end (set-marker (make-marker) end))
(save-excursion
(goto-char start)
(while (and (< (point) end) (search-forward "\r\n" end t))
(replace-match "\n" t t))
+ ;; Escape "\n\nFrom " (for mbox).
+ (goto-char start)
+ (while (re-search-forward "\n\n\\(From \\)" end t)
+ (replace-match "\n\n>\\1" t nil))
+ ;;
(goto-char start)
(while (and (< (point) end) (re-search-forward "^\\." end t))
(replace-match "" t t)
----------------------------cut here-------------------------------
--
Cheers,
-Dima.