emacs-format-all-the-code
emacs-format-all-the-code copied to clipboard
Change to separate customizations for formatters
Hi!
I just stumbled on issue #131 and thought about your comment:
Wow, we should really find a way to make it easier to configure format-all.
When using Emacs' customization dialogs, currently a huge list of formatters is saved. Without looking at your code, I see the following problem:
- it's not straight-forward to customize a single formatter
- users with customized formatters won't be able to see and use formatters newly introduced by updates
- or you'll have to add a lot of code to ensure that 2. does not happen
In other words, you have acquired some code debt. :smile:
I therefore suggest that you move from format-all-default-formatters to separate customizations such as format-all-formatter-python. This sounds like a nice task for LISP macros, although I'm not too familiar with elisp.
Best,
Martin
I agree that's the best move.
format-all-default-formatter-for-pythonformat-all-default-formatter-for-ruby- ...
That lets people choose from a menu as well. The Python setting can have a menu of black and yapf.
format-all-formatters should still stay for fine-grained control.
Still haven't got around to this :-/ If anyone wants to try their hand at a PR, please let me know.