I'm currently facing an issue where I am trying to save a file, but some save hook is triggering an auto formatting the file in a way that I do not want. I am not sure how to debug this issue. Ideally, I would be able to see all the events being executed when the save-hook is triggered.
Specifically, I want to edit a config file that looks something like this
# # my_config # SOMETHING=foo When I save this file, emacs autoformats the document and adds a space before and after =. I do not want this behavior and I am trying to figure out why on earth it's happening.
I am opening the buffer in text-mode. These are the minor mode emacs reports are enabled:
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Auto-Insert Blink-Cursor Column-Number Company Dap Dap-Auto-Configure Dap-Tooltip Dap-Ui Dap-Ui-Controls Dap-Ui-Many-Windows Electric-Indent File-Name-Shadow Flx-Ido Flycheck Flyspell Font-Lock Global-Auto-Revert Global-Company Global-Eldoc Global-Flycheck Global-Font-Lock Global-Git-Commit Ido-Everywhere Ido-Vertical Line-Number Lsp-Treemacs-Sync Magit-Auto-Revert Mouse-Wheel Projectile Recentf Save-Place Savehist Shell-Dirtrack Show-Paren Tooltip Transient-Mark Treemacs-Filewatch Treemacs-Follow Treemacs-Fringe-Indicator Treemacs-Git Visual-Line Which-Key Yas Yas-Global I am at a loss as to how I can debug this issue. Is there a clever way to see what emacs is doing when the save-hook is triggered?

emacs -Q(no init file)? If not, bisect your init file to find the culprit.save-hookare you referring to? Some variable? (Defined where?)