diff options
| -rw-r--r-- | lisp/mail/rmail.el | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 3147022d695..2d49a44bb85 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -580,20 +580,29 @@ argument causes us to read a file name and use that file as the inbox." | |||
| 580 | ;; the rmail-break-forwarded-messages feature is not implemented | 580 | ;; the rmail-break-forwarded-messages feature is not implemented |
| 581 | (defun rmail-convert-to-babyl-format () | 581 | (defun rmail-convert-to-babyl-format () |
| 582 | (let ((count 0) start | 582 | (let ((count 0) start |
| 583 | (case-fold-search nil)) | 583 | (case-fold-search nil) |
| 584 | (invalid-input-resync | ||
| 585 | (function (lambda () | ||
| 586 | (message "Invalid Babyl format in inbox!") | ||
| 587 | (sit-for 1) | ||
| 588 | ;; Try to get back in sync with a real message. | ||
| 589 | (if (re-search-forward | ||
| 590 | (concat mmdf-delim1 "\\|^From") nil t) | ||
| 591 | (beginning-of-line) | ||
| 592 | (goto-char (point-max))))))) | ||
| 584 | (goto-char (point-min)) | 593 | (goto-char (point-min)) |
| 585 | (save-restriction | 594 | (save-restriction |
| 586 | (while (not (eobp)) | 595 | (while (not (eobp)) |
| 587 | (cond ((looking-at "BABYL OPTIONS:");Babyl header | 596 | (cond ((looking-at "BABYL OPTIONS:");Babyl header |
| 588 | (search-forward "\n\^_") | 597 | (if (search-forward "\n\^_" nil t) |
| 589 | (delete-region (point-min) (point))) | 598 | ;; If we find the proper terminator, delete through there. |
| 599 | (delete-region (point-min) (point)) | ||
| 600 | (funcall invalid-input-resync) | ||
| 601 | (delete-region (point-min) (point))) | ||
| 590 | ;; Babyl format message | 602 | ;; Babyl format message |
| 591 | ((looking-at "\^L") | 603 | ((looking-at "\^L") |
| 592 | (or (search-forward "\n\^_" nil t) | 604 | (or (search-forward "\n\^_" nil t) |
| 593 | (progn | 605 | (funcall invalid-input-resync)) |
| 594 | (message "Invalid Babyl format in inbox!") | ||
| 595 | (sit-for 1) | ||
| 596 | (goto-char (point-max)))) | ||
| 597 | (setq count (1+ count)) | 606 | (setq count (1+ count)) |
| 598 | ;; Make sure there is no extra white space after the ^_ | 607 | ;; Make sure there is no extra white space after the ^_ |
| 599 | ;; at the end of the message. | 608 | ;; at the end of the message. |