On Thu, Sep 24, 1998 at 09:00:13AM -0500, Jason L Tibbitts III wrote:
> I guess it's not too bad to specify a sprintf-like format string and a list
> of strings/variables, all of which we can preprocess into some actual code
> which gets reval'd, but that might not do all of the fancy things. (Think
> of what Gnus does for summary buffer lines, if that means anything to you.
> End users can almost handle these things.)
The tricky thing about just doing sprintf stuff is that it's hard
to do centering and truncation of fields. In the format I use, I
truncate the name/email address if the subject line is long to
keep the line from wrapping. I really need to do the same with
the Subject portion to make sure that a subject line longer than
70ish characters doesn't screw up the formatting, but I never got
around to it.
> Or we could do a number of hardcoded formats, which is easier although less
> appealing. Or we could do both (choose canned format A, canned format B,
> or roll your own).
I think that would be the best way to do it, especially if there
are complicated formats that can't be done with simple sprintfs.
> What code do you use to generate your index format?
Here's the snippet that I use to format each line. The lines are
then pushed into an array, just like the existing digest program does it:
$subjects_authors_from = substr($from,0,71-length($subj));
$subjects_authors_width = length($subjects_authors_from) + length($subj);
$subjects_authors_center = " " x int(71-$subjects_authors_width);
$subjects_authors = "$subj $subjects_authors_center [$subjects_authors_from]";
I format the index so that there will be 2 spaces on the left
margin and 3 spaces on the right margin.
If you want to look at the compelete patch, it's at
I'd also be happy to send you a patched digest so you can see it