diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-04-24 18:39:05 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-04-30 13:25:52 +0200 |
commit | c61bbb4c8e7e2f2068c1cfac9a001806a1969202 (patch) | |
tree | 2708a16e72d6099b676c7e50d0ef11fe11e194c3 /doc/lispref/hooks.texi | |
parent | f478082f9ff22ff41fbd9616ebea75757f9a0311 (diff) | |
download | emacs-c61bbb4c8e7e2f2068c1cfac9a001806a1969202.tar.gz |
Don't poll auto-revert files that use notification (bug#35418)
It is a waste to periodically poll files that use change notification
in auto-revert mode; stop doing that. If no files need polling,
turn off the periodic execution entirely to further avoid wasting power.
Use a timer to inhibit immediate reversion for some time after a
notification, for throttling.
This change does not apply to files in global-auto-revert-mode, where
polling is still necessary. It is disabled by default, and enabled by
setting `auto-revert-avoid-polling' to non-nil.
* lisp/autorevert.el
(toplevel): Require cl-lib.
(auto-revert-avoid-polling, auto-revert--polled-buffers)
(auto-revert--need-polling-p, auto-revert--lockout-interval)
(auto-revert--lockout-timer, auto-revert--end-lockout): New.
(global-auto-revert-mode): Keep notifiers for buffers in auto-revert mode.
(auto-revert-set-timer): Use auto-revert--need-polling-p.
(auto-revert-notify-handler): Restart polling if notification stopped.
Use new lockout timer.
(auto-revert-buffers):
Use auto-revert--polled-buffers and auto-revert--need-polling-p.
(auto-revert-buffers-counter, auto-revert-buffers-counter-lockedout):
Remove.
* etc/NEWS (Changes in Specialized Modes and Packages):
Describe the new auto-revert-avoid-polling variable.
* doc/emacs/files.texi (Reverting):
Add paragraph describing auto-revert-avoid-polling.
Diffstat (limited to 'doc/lispref/hooks.texi')
0 files changed, 0 insertions, 0 deletions