summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-07-27 14:11:59 +0300
committerEli Zaretskii <eliz@gnu.org>2019-07-27 14:11:59 +0300
commitef85d54ca1e154088acd6b8f41c1312146edcc8f (patch)
tree13b7776436faea5366c0b70f3cc8054d43f4bf9d /lisp
parent51443b9a8354ef9a0578bd08a4ac769dc909daf9 (diff)
parentb41a763d9a7d83571779c6dae210bd4d5965f17c (diff)
downloademacs-ef85d54ca1e154088acd6b8f41c1312146edcc8f.tar.gz
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/autorevert.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 5c79a7e7955..6cdc1d3a297 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -266,7 +266,10 @@ buffers. CPU usage depends on the version control system."
(defvar-local global-auto-revert-ignore-buffer nil
"When non-nil, Global Auto-Revert Mode will not revert this buffer.
-This variable becomes buffer local when set in any fashion.")
+This variable can also be a predicate function, in which case
+it'll be called with one parameter (the buffer in question), and
+it should return non-nil to make Global Auto-Revert Mode not
+revert this buffer.")
(defcustom auto-revert-remote-files nil
"If non-nil remote files are also reverted."
@@ -541,7 +544,11 @@ specifies in the mode line."
(not (eq buffer-stale-function
#'buffer-stale--default-function))))
(not (memq 'major-mode global-auto-revert-ignore-modes))
- (not global-auto-revert-ignore-buffer))
+ (or (null global-auto-revert-ignore-buffer)
+ (if (functionp global-auto-revert-ignore-buffer)
+ (not (funcall global-auto-revert-ignore-buffer
+ (current-buffer)))
+ nil)))
(setq auto-revert--global-mode t)))
(defun auto-revert--global-adopt-current-buffer ()