Subject: Re: bug#35418: [PATCH] Don't poll auto-revert files that use notification

From: Mattias Engdegård <[email-masked]>
Date: Thu, 9 May 2019 12:00:17 +0200

5 maj 2019 kl. 11.58 skrev Mattias Engdegård <[email-masked]>:
> 
> What remains is avoiding polling in global-auto-revert-mode. I'll send a patch soon.

Here is that patch.

I understand that some people are queasy about using advice in code like this, and am open to suggestions about alternatives.
What the code needs is a reasonable (not necessarily bullet-proof) way to detect new file buffers and changes to buffer-file-name of those buffers. Monitoring `find-file-noselect' and `set-visited-file-name' turned out to be good enough.
For the former, it might be possible to get away with `after-change-major-mode-hook' instead (already used for non-file buffers).