Function: rmail-convert-file-maybe
rmail-convert-file-maybe is a byte-compiled function defined in
rmail.el.gz.
Signature
(rmail-convert-file-maybe)
Documentation
Determine if the file needs to be converted to mbox format.
Source Code
;; Defined in /usr/src/emacs/lisp/mail/rmail.el.gz
(defun rmail-convert-file-maybe ()
"Determine if the file needs to be converted to mbox format."
(widen)
(goto-char (point-min))
;; Detect previous Babyl format files.
(let ((case-fold-search nil))
(cond ((looking-at "BABYL OPTIONS:")
;; The file is Babyl version 5. Use unrmail to convert
;; it.
(rmail-convert-babyl-to-mbox))
((looking-at "Version: 5\n")
;; Losing babyl file made by old version of Rmail. Fix the
;; babyl file header and use unrmail to convert to mbox
;; format.
(let ((buffer-read-only nil))
(insert "BABYL OPTIONS: -*- rmail -*-\n")
(rmail-convert-babyl-to-mbox)))
((equal (point-min) (point-max))
(message "Empty Rmail file."))
((looking-at "From "))
(t (error "Invalid mbox file")))))