aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-04-03 22:09:35 -0400
committerGlenn Morris2014-04-03 22:09:35 -0400
commit8a1d24b11ef7bfed0752896cbfbcdd793f100b03 (patch)
tree23cfe23968dcc68b9649c745d76eae05d0ab720c
parent0360792967fa95567a9ec2d767f3a33563c1bbc5 (diff)
downloademacs-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.
-rw-r--r--doc/emacs/ChangeLog2
-rw-r--r--doc/emacs/arevert-xtra.texi6
-rw-r--r--doc/lispref/ChangeLog2
-rw-r--r--doc/lispref/backups.texi4
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/autorevert.el2
-rw-r--r--lisp/files.el12
8 files changed, 30 insertions, 9 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index bd593f49db3..c0581424833 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -3,6 +3,8 @@
3 * files.texi (Backup Names): 3 * files.texi (Backup Names):
4 * arevert-xtra.texi (Supporting additional buffers): 4 * arevert-xtra.texi (Supporting additional buffers):
5 Update for default values of some -function vars no longer being nil. 5 Update for default values of some -function vars no longer being nil.
6 (Supporting additional buffers):
7 Update for buffer-stale-function also applying to file-buffers.
6 8
72014-03-16 Dmitry Gutov <dgutov@yandex.ru> 92014-03-16 Dmitry Gutov <dgutov@yandex.ru>
8 10
diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi
index 0f05d1db0e1..dcb73bc96de 100644
--- a/doc/emacs/arevert-xtra.texi
+++ b/doc/emacs/arevert-xtra.texi
@@ -107,11 +107,11 @@ To support auto-reverting the buffer must first of all have a suitable
107@code{revert-buffer-function}. @xref{Definition of 107@code{revert-buffer-function}. @xref{Definition of
108revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}. 108revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
109 109
110In addition, it must have a @code{buffer-stale-function}. 110In addition, it must have a suitable @code{buffer-stale-function}.
111 111
112@c FIXME only defvar in all of doc/emacs! 112@c FIXME only defvar in all of doc/emacs!
113@defvar buffer-stale-function 113@defvar buffer-stale-function
114The value of this variable is a function to check whether a non-file 114The value of this variable is a function to check whether a
115buffer needs reverting. This should be a function with one optional 115buffer needs reverting. This should be a function with one optional
116argument @var{noconfirm}. The function should return non-@code{nil} 116argument @var{noconfirm}. The function should return non-@code{nil}
117if the buffer should be reverted. The buffer is current when this 117if the buffer should be reverted. The buffer is current when this
@@ -132,7 +132,7 @@ If you just want to automatically auto-revert every
132@code{auto-revert-interval} seconds (like the Buffer Menu), use: 132@code{auto-revert-interval} seconds (like the Buffer Menu), use:
133 133
134@example 134@example
135(set (make-local-variable 'buffer-stale-function) 135(setq-local buffer-stale-function
136 #'(lambda (&optional noconfirm) 'fast)) 136 #'(lambda (&optional noconfirm) 'fast))
137@end example 137@end example
138 138
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 456c2cbdc12..1fb664893f8 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -2,6 +2,8 @@
2 2
3 * backups.texi (Making Backups, Reverting): 3 * backups.texi (Making Backups, Reverting):
4 Update for default values of some -function vars no longer being nil. 4 Update for default values of some -function vars no longer being nil.
5 (Reverting): Update for buffer-stale-function
6 also applying to file-buffers.
5 7
62014-03-25 Eli Zaretskii <eliz@gnu.org> 82014-03-25 Eli Zaretskii <eliz@gnu.org>
7 9
diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi
index 9fa97fc1300..63f8f227c84 100644
--- a/doc/lispref/backups.texi
+++ b/doc/lispref/backups.texi
@@ -764,7 +764,9 @@ may or may not run this hook.
764@c FIXME? Move this section from arevert-xtra to here? 764@c FIXME? Move this section from arevert-xtra to here?
765@defvar buffer-stale-function 765@defvar buffer-stale-function
766The value of this variable specifies a function to call to check 766The value of this variable specifies a function to call to check
767whether a non-file buffer needs reverting 767whether a buffer needs reverting. The default value only handles
768buffers that are visiting files, by checking their modification time.
769Buffers that are not visiting files require a custom function
768@iftex 770@iftex
769(@pxref{Supporting additional buffers,,, emacs-xtra, Specialized Emacs Features}). 771(@pxref{Supporting additional buffers,,, emacs-xtra, Specialized Emacs Features}).
770@end iftex 772@end iftex
diff --git a/etc/NEWS b/etc/NEWS
index c3998934b5e..db1dd43216b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1401,11 +1401,14 @@ argument, with the same interpretation as the returned value of
1401 1401
1402** Revert and Autorevert changes 1402** Revert and Autorevert changes
1403 1403
1404FIXME buffer-stale-function no longer just for non-file buffers? 1404+++
1405*** The default values of `buffer-stale-function', `revert-buffer-function', 1405*** The default values of `buffer-stale-function', `revert-buffer-function',
1406and `revert-buffer-insert-file-contents-function' are no longer nil. 1406and `revert-buffer-insert-file-contents-function' are no longer nil.
1407Instead they default to functions that do what the nil value used to. 1407Instead they default to functions that do what the nil value used to.
1408 1408
1409+++
1410*** `buffer-stale-function' is now used for buffers visiting files too.
1411
1409--- 1412---
1410*** If Emacs is compiled with file notification support, it uses notifications 1413*** If Emacs is compiled with file notification support, it uses notifications
1411instead of checking file time stamps. To disable this, set the user option 1414instead of checking file time stamps. To disable this, set the user option
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c35be3ec270..f6340047e0a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-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
12014-04-03 Eli Zaretskii <eliz@gnu.org> 72014-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
672are checked. 672are checked.
673 673
674Non-file buffers that have a custom `revert-buffer-function' and 674Non-file buffers that have a custom `revert-buffer-function' and
675a `buffer-stale-function' are reverted either when Auto-Revert 675`buffer-stale-function' are reverted either when Auto-Revert
676Mode is active in that buffer, or when the variable 676Mode 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
678Auto-Revert Mode is active. 678Auto-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'.
5350This function ignores its argument. 5350This function ignores its argument.
5351This returns non-nil if the current buffer is visiting a readable file 5351This returns non-nil if the current buffer is visiting a readable file
5352whose modification time does not match that of the buffer." 5352whose modification time does not match that of the buffer.
5353
5354This function only handles buffers that are visiting files.
5355Non-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.
5359This should be a function with one optional argument NOCONFIRM. 5362This should be a function with one optional argument NOCONFIRM.
5360Auto Revert Mode passes t for NOCONFIRM. The function should return 5363Auto Revert Mode passes t for NOCONFIRM. The function should return
5361non-nil if the buffer should be reverted. A return value of 5364non-nil if the buffer should be reverted. A return value of
@@ -5450,7 +5453,10 @@ start and end.
5450 5453
5451Calls `revert-buffer-insert-file-contents-function' to reread the 5454Calls `revert-buffer-insert-file-contents-function' to reread the
5452contents of the visited file, with two arguments: the first is the file 5455contents of the visited file, with two arguments: the first is the file
5453name, the second is non-nil if reading an auto-save file." 5456name, the second is non-nil if reading an auto-save file.
5457
5458This function only handles buffers that are visiting files.
5459Non-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)