In some buffers (e.g.
diff buffers) the trailing whitespace is essential to the format and must be preserved. What is causing Emacs to invoke
delete-trailing-whitespace whenever I save the buffer?
(time-stamp), which doesn't alter trailing white space.
local-write-file-hooksall have the value
The active minor modes are, according to
Async-Bytecomp-Package Auto-Composition Auto-Compression Auto-Encryption Auto-Revert Column-Number Diff-Auto-Refine File-Name-Shadow Font-Lock Global-Eldoc Global-Font-Lock Global-Git-Commit Line-Number Magit-Auto-Revert Midnight Mouse-Wheel Projectile Projectile-Global Shell-Dirtrack Tool-Bar Tooltip Transient-Mark
None of those have any obvious behaviour to remove trailing whitespace on save.
This unwanted behaviour still happens even when I manually set
fundamentalmode in the buffer.
The backtrace when the
delete-trailing-whitespace function gets called looks like:
* delete-trailing-whitespace() * run-hook-with-args-until-success(delete-trailing-whitespace) * basic-save-buffer(t)
I haven't asked for
delete-trailing-whitespace, it's not in any relevant hooks that I can find, yet
run-hook-with-args-until-success is being told to run it. Why?