flymake-mode-on checks buffer-file-name first.