added function to do some tidying up in a lisp buffer