1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00
emacs/test/lisp
Mattias Engdegård e9f9827eb0 Avoid polling in global-auto-revert-mode (bug#35418)
Make `auto-revert-avoid-polling' have effect in global-auto-revert-mode.
Buffers actually handled by that mode are marked with a non-nil value
of `auto-revert--global-mode'.  When global-auto-revert-mode is
entered, eligible buffers are marked in that way, and hooks are set up
to mark new buffers and take care of buffers whose file names change.
This way the existing poll-avoidance logic can be used, since the
entire set of buffers in auto-revert is known.

A new hook, `after-set-visited-file-name-hook', was added to handle
the case when the file name of a tracked buffer changes.

* lisp/autorevert.el (auto-revert-avoid-polling): Amend doc string.
(auto-revert--global-mode): New buffer-local variable.
(global-auto-revert-mode): Mark existing buffers and set up hooks when
mode is entered; do the opposite when exited.
(auto-revert--global-add-current-buffer)
(auto-revert--global-adopt-current-buffer)
(auto-revert--set-visited-file-name-advice): New functions.
(auto-revert--polled-buffers, auto-revert--need-polling-p)
(auto-revert-notify-handler)
(auto-revert-active-p): Modify logic to cover global-auto-revert-mode.
* lisp/files.el (after-set-visited-file-name-hook): New hook.
(set-visited-file-name-hook): Call new hook.
* test/lisp/autorevert-tests.el (top):  Use lexical-binding.
(auto-revert-test--write-file, auto-revert-test--buffer-string)
(auto-revert-test--wait-for, auto-revert-test--wait-for-buffer-text)
(auto-revert-test05-global-notify): New test.
* doc/lispref/hooks.texi (Standard Hooks):
Mention new hook (in a comment, since it's unclear whether it should
actually be documented here)
* etc/NEWS (Changes in Specialized Modes and Packages): Update entry.
2019-05-20 11:26:51 +02:00
..
calc
calendar
custom-resources
emacs-lisp Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
emulation
erc
eshell
gnus ; Copyright years and license copyedits 2019-04-02 21:40:56 -07:00
international Import Unicode 12.0 data files 2019-03-09 12:41:48 +02:00
mail * lisp/mail/footnote.el: Tweak markers convention 2019-05-02 10:27:42 -04:00
net Suppress compiler warnings for older Emacsen in tramp-tests.el 2019-05-18 16:04:58 +02:00
nxml Recognize single quote attribute values in nxml and sgml (Bug#35381) 2019-05-09 06:42:40 -04:00
org Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
progmodes ; Add test for previous change 2019-04-28 16:45:13 -04:00
textmodes * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Fix typo 2019-05-15 22:21:36 -04:00
url
vc Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
abbrev-tests.el
arc-mode-tests.el
auth-source-pass-tests.el
auth-source-tests.el
autorevert-tests.el Avoid polling in global-auto-revert-mode (bug#35418) 2019-05-20 11:26:51 +02:00
buff-menu-tests.el
button-tests.el Distinguish buttons from widgets (bug#34506) 2019-04-07 03:56:27 +01:00
char-fold-tests.el
color-tests.el
comint-tests.el
custom-tests.el
dabbrev-tests.el
descr-text-tests.el
dired-aux-tests.el
dired-tests.el
dired-x-tests.el
dom-tests.el
electric-tests.el
epg-tests.el
faces-tests.el
ffap-tests.el
filenotify-tests.el ; SOme changes in filenotify-tests.el for EMBA 2019-05-05 13:34:26 +02:00
files-tests.el Don't rewrite buffer contents after saving by rename (Bug#35497) 2019-05-08 09:13:58 +02:00
files-x-tests.el Do not hardcode "/bin/sh" in compile. Bug#24338, Bug#29723 2019-03-09 16:44:24 +01:00
font-lock-tests.el Stop splicing anonymous faces in font-lock-append-text-property 2019-05-13 20:41:02 -04:00
help-fns-tests.el Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
hi-lock-tests.el
htmlfontify-tests.el
ibuffer-tests.el
ido-tests.el Add a new user option 'ido-big-directories'. 2019-04-19 10:31:02 +02:00
image-file-tests.el Replace use of obsolete string-make-unibyte 2019-04-28 16:45:13 -04:00
image-tests.el For SVG, 8192 is the new 256 2019-05-18 10:01:10 -07:00
imenu-tests.el
info-xref-tests.el
isearch-tests.el
jit-lock-tests.el
json-tests.el
jsonrpc-tests.el
kmacro-tests.el
ls-lisp-tests.el
man-tests.el
md4-tests.el Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
minibuffer-tests.el * test/lisp/minibuffer-tests.el (completion-table-subvert-test): New test 2019-03-20 10:52:30 -04:00
mouse-tests.el
obarray-tests.el
ps-print-tests.el
register-tests.el
replace-tests.el
rot13-tests.el
ses-tests.el
shadowfile-tests.el
shell-tests.el
simple-tests.el Fix recently extended delete-indentation behavior 2019-03-31 17:08:21 +01:00
sort-tests.el
soundex-tests.el Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
subr-tests.el Move proper-list-p tests to fns-tests.el 2019-04-12 14:25:36 +01:00
tar-mode-tests.el
term-tests.el Fix setting and resetting of scroll-with-delete 2019-05-07 14:51:42 -04:00
thingatpt-tests.el
thread-tests.el
wdired-tests.el Make wdired-mode ignore ls file indicators 2019-04-25 19:17:23 +02:00
whitespace-tests.el
wid-edit-tests.el Distinguish buttons from widgets (bug#34506) 2019-04-07 03:56:27 +01:00
xdg-tests.el Fixes for "Maintainer:" and related lines 2019-05-19 21:34:27 -07:00
xml-tests.el
xt-mouse-tests.el