(defun re-indent (string &optional n) (let ((code (ignore-errors (read-from-string string)))) (if code (with-output-to-string (str) (let ((*print-case* :downcase)) (if n (pprint-logical-block (str code :prefix (format nil "~v,,,' a" n #\space)) (write code :stream str)) (pprint code str)))) string)))