Improve project-vc-*cache-timeout docstrings

* lisp/progmodes/project.el: (project-vc-cache-timeout)
(project-vc-non-essential-cache-timeout): Improve docstrings (bug#78545).
This commit is contained in:
Dmitry Gutov 2026-02-10 18:56:31 +02:00
parent d91d8c98f8
commit d62370a0ec

View file

@ -598,15 +598,17 @@ See `project-vc-extra-root-markers' for the marker value format.")
"Number of seconds to cache a value in VC-aware project methods.
It can be nil, a number, or an alist where
the key is a predicate, and the value is a number.
A predicate function should take a directory string and if it returns
non-nil, the corresponding value will be used as the timeout.
Set to nil to disable time-based expiration.")
(defvar project-vc-non-essential-cache-timeout '((file-remote-p . nil)
(always . 300))
"Number of seconds to cache non-essential information.
Unlike `project-vc-cache-timeout' intended for interactive
commands, this variable has much more aggressive caching,
and is intended for \"background\" things like `project-mode-line'
indicators and `project-uniquify-dirname-transform'.
The format of the value is same as `project-vc-cache-timeout', but while
the former is intended for interactive commands, this variable uses
higher numbers, intended for \"background\" things like
`project-mode-line' indicators and `project-uniquify-dirname-transform'.
It is used when `non-essential' is non-nil.")
(defun project--get-cached (dir key)