summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-05-08 00:02:59 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2019-05-18 14:16:21 +0200
commit1943220d1b7ed28b2708c86acfe5493d5c6e3089 (patch)
tree463bdfba333ec0637376d9fe4fc144fbc07bde0d /lisp/files.el
parent4bf447bb912d73c4637f1094c265994dd99ff7e8 (diff)
downloademacs-1943220d1b7ed28b2708c86acfe5493d5c6e3089.tar.gz
Don't use file notification on non-file buffers
Allow non-file buffers to declare that notification on their default-directory is sufficient to know when auto-revert updates are required by setting the new variable `buffer-auto-revert-by-notification' to non-nil. If nil, the default, then auto-revert will poll those buffers instead. (bug#35418). Currently, only Dired sets that variable. * lisp/autorevert.el (auto-revert-buffers): Modify condition for using notification. * lisp/files.el (buffer-auto-revert-by-notification): New variable. * lisp/dired.el (dired-mode): Set buffer-auto-revert-by-notification. * doc/emacs/arevert-xtra.texi (Non-File Buffers): Document new variable. * etc/NEWS (Changes in Specialized Modes and Packages): Describe new variable.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 8fa7f16de01..1dec0ed7ca9 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5890,6 +5890,16 @@ This should not be relied upon.
For more information on how this variable is used by Auto Revert mode,
see Info node `(emacs)Supporting additional buffers'.")
+(defvar-local buffer-auto-revert-by-notification nil
+ "Whether a buffer can rely on notification in Auto-Revert mode.
+If non-nil, monitoring changes to the directory of the current
+buffer is sufficient for knowing when that buffer needs to be
+updated in Auto Revert Mode. Such notification does not include
+changes to files in that directory, only to the directory itself.
+
+This variable only applies to buffers where `buffer-file-name' is
+nil; other buffers are tracked by their files.")
+
(defvar before-revert-hook nil
"Normal hook for `revert-buffer' to run before reverting.
The function `revert-buffer--default' runs this.