From: Pascal Costanza
Subject: CLOS / MOP discussion archives for Thunderbird
Date: 
Message-ID: <co539u$sm6$1@newsreader2.netcologne.de>
Hi,

The ftp site ftp://parcftp.xerox.com/pub/pcl/ contains an archive of 
what seems to be the original mailing list for the designers of CLOS and 
its MOP. There is a lot of information contained in it that explains the 
ideas and rationale behind the design decisions.

The problem with that archive is that it is stored in a format that 
doesn't seem to comply with current mailbox formats. A friend of mine 
(Axel Katerbau from http://www.objectpark.net/ ) has some experience 
with such formats, and so has written one of his first Lisp programs to 
convert the format of that archive to one that is accepted by 
Thunderbird / Mozilla. The conversion is not perfect, but makes the 
archive much more readable. (Unfortunately, the conversion doesn't work 
well for Apple Mail, and probably other mail clients.)

Anyway, here is the program for doing the conversion (I have polished it 
a bit). I hope this is helpful to some.

Pascal

(defun received-line-p (line)
   "Test whether it's a line beginning with Received: "
   (eql (search "Received: " line) 0))

(defun copy-header (input output)
   "Read rest of message header"
   (loop for line = (read-line input nil "")
         until (equal line "")
         do (format output "~A~%" line)))

(defun from-quoted-body-line (line)
   (if (eql (search "From " line) 0)
       (format nil ">~A" line)
     line))

(defun convert-ml (path)
   "Converts a strange mailinglist archive (e.g. mob.text)
    at the given path into mbox format (<path>.mbox)"
   (with-open-file (input path :direction :input)
     (with-open-file (output (format nil "~A.mbox" path)
                             :direction :output :if-exists :supersede)
       (loop for line = (read-line input nil 'eof)
             until (eq line 'eof)
             if (received-line-p line)
             do (progn
                  (format output "From <new msg marker>~%~A~%" line)
                  (copy-header input output)
                  (format output "~%"))
             else do (format output "~A~%"
                             (from-quoted-body-line line))))))


-- 
Tyler: "How's that working out for you?"
Jack: "Great."
Tyler: "Keep it up, then."

From: Klaus Weidner
Subject: Re: CLOS / MOP discussion archives for Thunderbird
Date: 
Message-ID: <M8Rrd.6097828$6p.972445@news.easynews.com>
On 2004-11-25, Pascal Costanza <········@web.de> wrote:
> The problem with that archive is that it is stored in a format that 
> doesn't seem to comply with current mailbox formats. A friend of mine 
> (Axel Katerbau from http://www.objectpark.net/ ) has some experience 
> with such formats, and so has written one of his first Lisp programs to 
> convert the format of that archive to one that is accepted by 
> Thunderbird / Mozilla. The conversion is not perfect, but makes the 
> archive much more readable. (Unfortunately, the conversion doesn't work 
> well for Apple Mail, and probably other mail clients.)

Thanks! Lightly modified version below.

The inserted "From " line wasn't standards compliant, the following works 
(including the threaded view) for the "mutt" mail client.

-Klaus

(defun received-line-p (line)
   "Test whether it's a line beginning with Received: "
   (eql (search "Received: " line) 0))

(defun copy-header (input output)
   "Read rest of message header"
   (loop for line = (read-line input nil "")
         until (equal line "")
         do (format output "~A~%" line)))

(defun from-quoted-body-line (line)
   (if (eql (search "From " line) 0)
       (format nil ">~A" line)
     line))

(defun convert-ml (path)
   "Converts a strange mailinglist archive (e.g. mob.text)
    at the given path into mbox format (<path>.mbox)"
   (with-open-file (input path :direction :input)
     (with-open-file (output (format nil "~A.mbox" path)
                             :direction :output :if-exists :supersede)
       (loop for line = (read-line input nil 'eof)
             until (eq line 'eof)
             if (received-line-p line)
             do (progn
                  (format output "From ·@example.com Mon Jan  1 00:00:00 1990~%~A~%" line)
                  (copy-header input output)
                  (format output "~%"))
             else do (format output "~A~%"
                             (from-quoted-body-line line))))))
From: Håkon Alstadheim
Subject: Re: CLOS / MOP discussion archives for Thunderbird
Date: 
Message-ID: <m0sm6nk7p4.fsf@alstadheim.priv.no>
Klaus Weidner <··@w-m-p.com> writes:

> (defun from-quoted-body-line (line)
>    (if (eql (search "From " line) 0)
>        (format nil ">~A" line)
>      line))

Just a nit, this is a bit wasteful, use STRING= with :start1 and :end1
instead of SEARCH.

-- 
H�kon Alstadheim, hjemmepappa.