# HG changeset patch # User Chong Yidong # Date 1228509798 0 # Node ID 173f33792438084d5b7ef1477387db315e0f2ec7 # Parent 6096a270eba8e0d5fa214e93b3a2712d4576ca41 (pmail-convert-babyl-to-mbox): Reinitialize pmail-mode variables after conversion. diff -r 6096a270eba8 -r 173f33792438 lisp/mail/pmail.el --- a/lisp/mail/pmail.el Fri Dec 05 20:43:11 2008 +0000 +++ b/lisp/mail/pmail.el Fri Dec 05 20:43:18 2008 +0000 @@ -945,17 +945,23 @@ (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"))