Regroup settings.
Better whitespace stripping (preserves cursor location).
Restore cursor position and unfold.