diff options
| author | Eli Zaretskii | 2019-07-27 14:11:59 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-07-27 14:11:59 +0300 |
| commit | ef85d54ca1e154088acd6b8f41c1312146edcc8f (patch) | |
| tree | 13b7776436faea5366c0b70f3cc8054d43f4bf9d | |
| parent | 51443b9a8354ef9a0578bd08a4ac769dc909daf9 (diff) | |
| parent | b41a763d9a7d83571779c6dae210bd4d5965f17c (diff) | |
| download | emacs-ef85d54ca1e154088acd6b8f41c1312146edcc8f.tar.gz emacs-ef85d54ca1e154088acd6b8f41c1312146edcc8f.zip | |
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/autorevert.el | 11 |
2 files changed, 14 insertions, 2 deletions
| @@ -1696,6 +1696,11 @@ the new variable 'buffer-auto-revert-by-notification' to a non-nil | |||
| 1696 | value. Auto Revert mode can use this information to avoid polling the | 1696 | value. Auto Revert mode can use this information to avoid polling the |
| 1697 | buffer periodically when 'auto-revert-avoid-polling' is non-nil. | 1697 | buffer periodically when 'auto-revert-avoid-polling' is non-nil. |
| 1698 | 1698 | ||
| 1699 | --- | ||
| 1700 | *** `global-auto-revert-ignore-buffer' can now also be a predicate | ||
| 1701 | function that can be used for more fine-grained control of which | ||
| 1702 | buffers to auto-revert. | ||
| 1703 | |||
| 1699 | ** auth-source-pass | 1704 | ** auth-source-pass |
| 1700 | 1705 | ||
| 1701 | +++ | 1706 | +++ |
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." | |||
| 266 | 266 | ||
| 267 | (defvar-local global-auto-revert-ignore-buffer nil | 267 | (defvar-local global-auto-revert-ignore-buffer nil |
| 268 | "When non-nil, Global Auto-Revert Mode will not revert this buffer. | 268 | "When non-nil, Global Auto-Revert Mode will not revert this buffer. |
| 269 | This variable becomes buffer local when set in any fashion.") | 269 | This variable can also be a predicate function, in which case |
| 270 | it'll be called with one parameter (the buffer in question), and | ||
| 271 | it should return non-nil to make Global Auto-Revert Mode not | ||
| 272 | revert this buffer.") | ||
| 270 | 273 | ||
| 271 | (defcustom auto-revert-remote-files nil | 274 | (defcustom auto-revert-remote-files nil |
| 272 | "If non-nil remote files are also reverted." | 275 | "If non-nil remote files are also reverted." |
| @@ -541,7 +544,11 @@ specifies in the mode line." | |||
| 541 | (not (eq buffer-stale-function | 544 | (not (eq buffer-stale-function |
| 542 | #'buffer-stale--default-function)))) | 545 | #'buffer-stale--default-function)))) |
| 543 | (not (memq 'major-mode global-auto-revert-ignore-modes)) | 546 | (not (memq 'major-mode global-auto-revert-ignore-modes)) |
| 544 | (not global-auto-revert-ignore-buffer)) | 547 | (or (null global-auto-revert-ignore-buffer) |
| 548 | (if (functionp global-auto-revert-ignore-buffer) | ||
| 549 | (not (funcall global-auto-revert-ignore-buffer | ||
| 550 | (current-buffer))) | ||
| 551 | nil))) | ||
| 545 | (setq auto-revert--global-mode t))) | 552 | (setq auto-revert--global-mode t))) |
| 546 | 553 | ||
| 547 | (defun auto-revert--global-adopt-current-buffer () | 554 | (defun auto-revert--global-adopt-current-buffer () |