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

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 20 May 2019 19:20:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
35418: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35418
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#35418: [PATCH] Don't poll auto-revert files that use notification
From: Mattias Engdegård <[email-masked]>
To: Michael Albinus <[email-masked]>
Cc: Eli Zaretskii <[email-masked]>, [email-masked]
Date: Mon, 20 May 2019 21:19:37 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

20 maj 2019 kl. 09.30 skrev Michael Albinus <[email-masked]>:
> 
> From my POV, the patch is fine, and could be committed. Whether it is
> successful will be told us by emba.gnu.org (and hydra.nixos.org).

Thanks for your diligence and patience; closing.

Subject: [PATCH] Don't poll auto-revert files that use notification
From: Mattias Engdegård <[email-masked]>
To: [email-masked]
Cc: Michael Albinus <[email-masked]>
Date: Wed, 24 Apr 2019 20:14:46 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

It is a waste of power, on battery-powered devices in particular, to poll files in auto-revert mode periodically when change notification is used. The change is straightforward (attached patch); the main concern is whether the notification system is reliable enough.

In general, it probably is. There is a comment in w32notify.c about SMB-mounted file systems from Samba servers; while Samba does support notification nowadays, there are probably older systems still be deficient in that regard. However, isn't this what `auto-revert-notify-exclude-dir-regexp' is for? I'm not familiar with the way Emacs is used on Windows, but would adding something like

 (rx bos
     (or "\\\\" "//")
     (one-or-more (not (any "/:\\")))
     (any "/\\"))

to `auto-revert-notify-exclude-dir-regexp' be a good start?

Another note about what this patch does not do: global-auto-revert-mode will still use polling. This could be added later on, if there is a good place to hook into for buffer creation.