#!/usr/bin/perl
#  (well, not really... this is really a perl-vile procedure

sub format_mail {
    my $cur_line;
    my $line = 1;
    $Vile::current_buffer->set_region(1,$$);
    while (<$Vile::current_buffer>) {
	last if $_ eq "\n";
	$line++;
    }
    $Vile::current_buffer->set_region(1,$line-1)
                         ->attribute('color' => 6);

    # now, let's keep wandering on and color other stuff!
    # we'll color quotes cyan, too.  We do this a line at a
    # time instead of the whole thing so that our insertions
    # will be in fcolor instead of cyan.  (That's also why we
    # do the set_region to the line below as we do, as it makes
    # the end of line not be actually part of the line.)

    $Vile::current_buffer->set_region($line,$$);
    $cur_line = $Vile::current_buffer;
    while (<$Vile::current_buffer>) {
	if (/^> /) {
	    $cur_line->set_region($line,0,$line,$$);
	    $cur_line->attribute('color' => 6);
	}
	$line++
    }
}

1;

