PR #4351 has been merged into the "devel" and "6.84" branches. This PR automatically beautifies scripts when the setting @bool beautify-python-code-on-write is True. The PR also provides a beautify-tree command.
Previous similar projects failed because they could not handle section references properly. The stumbling block was devising "stand-in" code that would always satisfy Python's parser. But now Leo's beautifier only uses tokens, so the stand-in code must only satisfy Python's tokenizer, which is a much easier job.
This PR is (really!) likely to be the last for Leo 6.8.4. Please continue testing and report any problems. Thanks.
Edward