RFC 2822 says to do header folding you simply insert a crlf before a whitespace character and to unfold you simply remove that crlf.
I am trying to do this on VM with pipelines. Right now I am using: spill 78 anyof /whitespace-chars/ offset / / to fold, and to unfold I use joincont leading anyof /whitespace-chars/ keep but this isn't quite the same since the whitespace char it spills at is removed and the subsequent line(s) have a hardcoded blank inserted at the front. Now for all practical purposes thats "good enough" since a hardcoded blank IS a whitespace character, its just not THE whitespace character the line was spilled at and that bothers me (admittedly an insufferable purist). Alright, I can use KEEP to get spill to keep the original whitespace character, but that leaves it on the end of the line. I'd like to somehow get it to use the spill character as the OFFSET rather than the hardcoded blank. If I could do that, I can restore the original data exactly as it was before being folded. Even nicer would be a built-in FOLD and UNFOLD filter that did RFC-compliant folding and unfolding, but I'll settle for what I can get (if anything :-). -- bc
