Auto-Compile isn't the only one triggering compilation. When something else does it, then `auto-compile-file-buffer' is nil.
to allow inhibiting automatic compilation under user-defined circumstances. Also add `auto-compile-inhibit-compile-detached-git-head' but do not add it to the hook variable's default value. Start using `cl-defun' to define `auto-compile-byte-compile' and then use `cl-return-from' to abort compilation when the hook succeeds. This avoids having to reindent the whole thing.
as an alternative to automatically displaying the *Compile-Log* buffer when there are warnings. Add new options `auto-compile-display-buffer' and `auto-compile-mode-line-counter' to control the behavior. Setting the former to nil and the latter to t makes the automatic compilation less intrusive.
Setting this to t is problematic when Magit, VC, or some other version control mode is used. When that is the case Auto-Compile can get very confused.