aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-12-05 20:43:18 +0000
committerChong Yidong2008-12-05 20:43:18 +0000
commitc786a9292103fc0d99d1c70f9505bac840660b40 (patch)
treeb5cac747c01e5009f79fc0b92b735872fe20544f
parentcab320968e51597beec88276b0f0ff8642091f21 (diff)
downloademacs-c786a9292103fc0d99d1c70f9505bac840660b40.tar.gz
emacs-c786a9292103fc0d99d1c70f9505bac840660b40.zip
(pmail-convert-babyl-to-mbox): Reinitialize pmail-mode variables after
conversion.
-rw-r--r--lisp/mail/pmail.el8
1 files changed, 7 insertions, 1 deletions
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."
945 (error "Invalid mbox format mail file."))) 945 (error "Invalid mbox format mail file.")))
946 946
947(defun pmail-convert-babyl-to-mbox () 947(defun pmail-convert-babyl-to-mbox ()
948 "Convert the mail file from Babyl version 5 to mbox." 948 "Convert the mail file from Babyl version 5 to mbox.
949This function also reinitializes local variables used by Pmail."
949 (let ((old-file (make-temp-file "pmail")) 950 (let ((old-file (make-temp-file "pmail"))
950 (new-file (make-temp-file "pmail"))) 951 (new-file (make-temp-file "pmail")))
951 (unwind-protect 952 (unwind-protect
952 (progn 953 (progn
954 (kill-all-local-variables)
953 (write-region (point-min) (point-max) old-file) 955 (write-region (point-min) (point-max) old-file)
954 (unrmail old-file new-file) 956 (unrmail old-file new-file)
957 (unrmail old-file "/home/cyd/pmail-test")
955 (message "Replacing BABYL format with mbox format...") 958 (message "Replacing BABYL format with mbox format...")
956 (let ((inhibit-read-only t)) 959 (let ((inhibit-read-only t))
957 (erase-buffer) 960 (erase-buffer)
958 (insert-file-contents-literally new-file) 961 (insert-file-contents-literally new-file)
962 (pmail-mode-1)
963 (pmail-perm-variables)
964 (pmail-variables)
959 (goto-char (point-max)) 965 (goto-char (point-max))
960 (pmail-set-message-counters)) 966 (pmail-set-message-counters))
961 (message "Replacing BABYL format with mbox format...done")) 967 (message "Replacing BABYL format with mbox format...done"))