lassik / emacs-format-all-the-code

Auto-format source code in many languages with one command
https://melpa.org/#/format-all
MIT License
604 stars 105 forks source link

How to stop automatically format the file when saving the file? #253

Open beyondpie opened 6 months ago

beyondpie commented 6 months ago

Hi there,

This is really a fantastic package, and I am now using it everyday. One problem I now have is that, once I open the format-all mode, it will automatically format the file every time when I save the file. I hope to only format the file when I need.

I notice that the hook format-all--buffer-from-hook is registered into before-save-hook, and I can remove that function out of before-save-hook. It works as I expected. But when I start to format the code using format-all-buffer function, it seems that format-all--buffer-from-hook again is registered into before-save-hook.

Do you know how can we remove or allow the user to control this behavior? For me, I think, I can add one add-advice function to format-all-buffer, but not sure if there is some official method?

Thanks! Songpeng