I quite like the global Auto Revert mode. It is especially useful when I something else than Emacs sometimes changes my files. (I bet some readers immediately thought about the now-fashionable agentic coding, but plain old git switch is enough!) It has one drawback, however. I hardly ever use TeX nowadays, but when I do, I use pdf-tools. Auto Revert mode doesn’t play nice with pdfs open in Emacs, often trying to revert them before TeX finishes writing to them, which results in ugly flickering. The thing is, I don’t need auto-reverting TeX-generated pdf files, since I have this in my init.el:
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)
So, what can I do besides temporarily disabling the global Auto Revert mode when using TeX? It turns out that there exists a simple and elegant solution:
(setq global-auto-revert-ignore-modes '(pdf-view-mode))
Make sure to check out the manual if you want to further customize Auto Revert. Personally, I’ve set auto-revert-verbose to nil. When a file is changed by something else than Emacs, it is always the result of my actions. This means that I already know that Emacs should revert it, and hence the messages are useless to me. (You could argue that it is possible that some malware could be doing something to my files, and disabling the verbosity of Auto Revert mode would make it harder for me to notice. That is a weak argument, since (a) Emacs produces so many messages that it would be easy to miss some of them, and (b) the vast majority of my projects are Git-controlled, so I would notice anyway when staging the changes.)
That’s it for today, see you in a week!