Sedding mail citations
Apr. 11th, 2006 05:44 pmIn order to correct a somewhat obscure pet peeve — I hate the way that some mail clients add extra blank citation lines between blocks of text — I've come up with the following particularly unpleasant piece of sed:
s/\(^>\+\) \+$/\1/ /^>\+$/ { h d } /^>\+.\+$/ { H x s/^\n\+//g p s/^.*// h d }
While it appears to work on the relatively few test cases I've tried, I'm pretty sure that there's some unpleasantly wrong with it, something that's only going to become obvious in a couple of months time when I've forgotten how the stupid thing is supposed to do it's magic. Now that I think about it, maybe I don't find those duplicate blank lines all that annoying after all...