On Wednesday 26 December 2007, Josiah Worcester wrote:
> Misformatting is your fault, not mine

Your rule is indeed misformatted AFAICS.

* tab characters are used instead of spaces
* there is a tab character after "via" where there should be a space
* the number of characters in each line is 75ish, compared to the normal 70

You are using KMail, and therefore I'm sure you can use several other 
editors including Kate that support piping text through stuff.  You could 
use Zefram's "afmt" that was posted a while back, or here are some PHP 
hacks I use: (both take the number of characters on the left as an 
optional argument)

awrap:

#!/usr/bin/php
<?php
if(empty($argv[1])) $a = 6; else $a = (int) $argv[1];
echo preg_replace('/^/m', str_repeat(' ', $a),
wordwrap(
        file_get_contents('php://stdin'),
        70 - $a
));
?>

aunwrap:

#!/usr/bin/php
<?php
$sentence = isset($argv[1]) ? ((int) $argv[1]) : '6';
echo trim(
        str_replace(array("\t", "\r"), '',
        preg_replace("/(?<!\n)\n(?!\n)/", "",
        preg_replace("/^\s*$/m", "",
        preg_replace('/([^ ])([\r\n])/', '$1 $2',
        preg_replace('/['.chr(160).chr(32).']{'.$sentence.'}/', "\t", 
file_get_contents('php://stdin'))))))) . "\n";
?>

FWIW even if the proposal was well formatted and had a good mechanism for 
enforcement, I would be against it.  Don't fix what ain't broke; wait for 
someone to break it first.  Or do that yourself by making some interesting 
scam...




Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to