emacs-format-all-the-code icon indicating copy to clipboard operation
emacs-format-all-the-code copied to clipboard

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

Open beyondpie opened this issue 1 year ago • 0 comments
trafficstars

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

beyondpie avatar Mar 02 '24 23:03 beyondpie