[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Mattias Engdegård
Subject: bug#35418: [PATCH] Don't poll auto-revert files that use notification
Date: Wed, 24 Apr 2019 20:14:46 +0200

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 

 (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.

Attachment: 0001-Don-t-poll-auto-revert-files-that-use-notification.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]