summaryrefslogtreecommitdiff
path: root/doc/lispref/files.texi
diff options
context:
space:
mode:
authorGregory Heytings <gregory@heytings.org>2021-11-01 14:51:57 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-11-01 14:51:57 +0100
commitdaea9b3b44a4dc09017c3d2d5b8eaa4c68cdd2b0 (patch)
tree700b380dd3566886993346417b467f17d22ddf86 /doc/lispref/files.texi
parent453d104602a04521afd46b57c05462b6bc74305b (diff)
downloademacs-daea9b3b44a4dc09017c3d2d5b8eaa4c68cdd2b0.tar.gz
emacs-daea9b3b44a4dc09017c3d2d5b8eaa4c68cdd2b0.tar.bz2
emacs-daea9b3b44a4dc09017c3d2d5b8eaa4c68cdd2b0.zip
Read mailcaps again only when necessary
* doc/lispref/files.texi (File Attributes): Document it. * lisp/files.el (file-has-changed-p): New function. (file-has-changed-p--hash-table): Internal variable used by the new function (bug#51523). * lisp/emacs-lisp/shortdoc.el (file): Mention it. * lisp/net/mailcap.el (mailcap-parse-mailcaps): Read mailcaps again only when at least one of the mailcap files has changed. Fixes bug#51523.
Diffstat (limited to 'doc/lispref/files.texi')
-rw-r--r--doc/lispref/files.texi9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 59e18b32c2e..250f7a3f9f5 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1314,6 +1314,15 @@ on the 19th, @file{aug-20} was written on the 20th, and the file
@end example
@end defun
+@defun file-has-changed-p filename
+This convenience function is useful when, for instance, parsing files
+run-time, and you typically want to re-read a file when it has
+changed. This function returns non-@code{nil} the first time it's
+called on @var{filename} in an Emacs session, but will return
+@code{nil} on subsequent calls in that session (unless the file
+changes its modification time).
+@end defun
+
@defun file-attributes filename &optional id-format
@anchor{Definition of file-attributes}
This function returns a list of attributes of file @var{filename}. If