This definition uses string-tokenize to split the string argument on newliness, then uses map to process each line, removing any existing leading space and then appending the proper indentation to the start of each line. Finally, the result of map is passed to string-join, which joins the result with newlines.
-- GordonWeakliem - 26 Apr 2004