From: Chong Yidong Date: Fri, 5 Dec 2008 20:43:18 +0000 (+0000) Subject: (pmail-convert-babyl-to-mbox): Reinitialize pmail-mode variables after X-Git-Tag: emacs-pretest-23.0.90~1243 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c786a9292103fc0d99d1c70f9505bac840660b40;p=emacs.git (pmail-convert-babyl-to-mbox): Reinitialize pmail-mode variables after conversion. --- diff --git a/lisp/mail/pmail.el b/lisp/mail/pmail.el index e3e683bdae8..1549d98ac08 100644 --- a/lisp/mail/pmail.el +++ b/lisp/mail/pmail.el @@ -945,17 +945,23 @@ MSGNUM, if present, indicates the malformed message." (error "Invalid mbox format mail file."))) (defun pmail-convert-babyl-to-mbox () - "Convert the mail file from Babyl version 5 to mbox." + "Convert the mail file from Babyl version 5 to mbox. +This function also reinitializes local variables used by Pmail." (let ((old-file (make-temp-file "pmail")) (new-file (make-temp-file "pmail"))) (unwind-protect (progn + (kill-all-local-variables) (write-region (point-min) (point-max) old-file) (unrmail old-file new-file) + (unrmail old-file "/home/cyd/pmail-test") (message "Replacing BABYL format with mbox format...") (let ((inhibit-read-only t)) (erase-buffer) (insert-file-contents-literally new-file) + (pmail-mode-1) + (pmail-perm-variables) + (pmail-variables) (goto-char (point-max)) (pmail-set-message-counters)) (message "Replacing BABYL format with mbox format...done"))