diff options
| author | Glenn Morris | 2014-04-03 22:09:35 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-04-03 22:09:35 -0400 |
| commit | 8a1d24b11ef7bfed0752896cbfbcdd793f100b03 (patch) | |
| tree | 23cfe23968dcc68b9649c745d76eae05d0ab720c /lisp | |
| parent | 0360792967fa95567a9ec2d767f3a33563c1bbc5 (diff) | |
| download | emacs-8a1d24b11ef7bfed0752896cbfbcdd793f100b03.tar.gz emacs-8a1d24b11ef7bfed0752896cbfbcdd793f100b03.zip | |
Doc updates for buffer-stale-function now applying to file buffers too
* doc/emacs/arevert-xtra.texi (Supporting additional buffers):
* doc/lispref/backups.texi (Reverting):
Update for buffer-stale-function also applying to file-buffers.
* lisp/autorevert.el (auto-revert-buffers):
* lisp/files.el (buffer-stale--default-function)
(buffer-stale-function, revert-buffer--default): Doc tweaks.
* etc/NEWS: Related edits.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/autorevert.el | 2 | ||||
| -rw-r--r-- | lisp/files.el | 12 |
3 files changed, 16 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c35be3ec270..f6340047e0a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-04-04 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * files.el (buffer-stale--default-function) | ||
| 4 | (buffer-stale-function, revert-buffer--default): | ||
| 5 | * autorevert.el (auto-revert-buffers): Doc tweaks. | ||
| 6 | |||
| 1 | 2014-04-03 Eli Zaretskii <eliz@gnu.org> | 7 | 2014-04-03 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * international/characters.el: Preload uni-mirrored.el. (Bug#17169) | 9 | * international/characters.el: Preload uni-mirrored.el. (Bug#17169) |
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index a08bf7fee6a..f1074e22e51 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -672,7 +672,7 @@ Should `auto-revert-mode' be active in some buffers, those buffers | |||
| 672 | are checked. | 672 | are checked. |
| 673 | 673 | ||
| 674 | Non-file buffers that have a custom `revert-buffer-function' and | 674 | Non-file buffers that have a custom `revert-buffer-function' and |
| 675 | a `buffer-stale-function' are reverted either when Auto-Revert | 675 | `buffer-stale-function' are reverted either when Auto-Revert |
| 676 | Mode is active in that buffer, or when the variable | 676 | Mode is active in that buffer, or when the variable |
| 677 | `global-auto-revert-non-file-buffers' is non-nil and Global | 677 | `global-auto-revert-non-file-buffers' is non-nil and Global |
| 678 | Auto-Revert Mode is active. | 678 | Auto-Revert Mode is active. |
diff --git a/lisp/files.el b/lisp/files.el index d5c6028ff47..e721a813a59 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -5349,13 +5349,16 @@ This should not be relied upon.") | |||
| 5349 | "Default function to use for `buffer-stale-function'. | 5349 | "Default function to use for `buffer-stale-function'. |
| 5350 | This function ignores its argument. | 5350 | This function ignores its argument. |
| 5351 | This returns non-nil if the current buffer is visiting a readable file | 5351 | This returns non-nil if the current buffer is visiting a readable file |
| 5352 | whose modification time does not match that of the buffer." | 5352 | whose modification time does not match that of the buffer. |
| 5353 | |||
| 5354 | This function only handles buffers that are visiting files. | ||
| 5355 | Non-file buffers need a custom function" | ||
| 5353 | (and buffer-file-name | 5356 | (and buffer-file-name |
| 5354 | (file-readable-p buffer-file-name) | 5357 | (file-readable-p buffer-file-name) |
| 5355 | (not (verify-visited-file-modtime (current-buffer))))) | 5358 | (not (verify-visited-file-modtime (current-buffer))))) |
| 5356 | 5359 | ||
| 5357 | (defvar buffer-stale-function #'buffer-stale--default-function | 5360 | (defvar buffer-stale-function #'buffer-stale--default-function |
| 5358 | "Function to check whether a non-file buffer needs reverting. | 5361 | "Function to check whether a buffer needs reverting. |
| 5359 | This should be a function with one optional argument NOCONFIRM. | 5362 | This should be a function with one optional argument NOCONFIRM. |
| 5360 | Auto Revert Mode passes t for NOCONFIRM. The function should return | 5363 | Auto Revert Mode passes t for NOCONFIRM. The function should return |
| 5361 | non-nil if the buffer should be reverted. A return value of | 5364 | non-nil if the buffer should be reverted. A return value of |
| @@ -5450,7 +5453,10 @@ start and end. | |||
| 5450 | 5453 | ||
| 5451 | Calls `revert-buffer-insert-file-contents-function' to reread the | 5454 | Calls `revert-buffer-insert-file-contents-function' to reread the |
| 5452 | contents of the visited file, with two arguments: the first is the file | 5455 | contents of the visited file, with two arguments: the first is the file |
| 5453 | name, the second is non-nil if reading an auto-save file." | 5456 | name, the second is non-nil if reading an auto-save file. |
| 5457 | |||
| 5458 | This function only handles buffers that are visiting files. | ||
| 5459 | Non-file buffers need a custom function." | ||
| 5454 | (with-current-buffer (or (buffer-base-buffer (current-buffer)) | 5460 | (with-current-buffer (or (buffer-base-buffer (current-buffer)) |
| 5455 | (current-buffer)) | 5461 | (current-buffer)) |
| 5456 | (let* ((auto-save-p (and (not ignore-auto) | 5462 | (let* ((auto-save-p (and (not ignore-auto) |