Function: fast-lock-read-cache
fast-lock-read-cache is an interactive and byte-compiled function
defined in fast-lock.el.gz.
Signature
(fast-lock-read-cache)
Documentation
Read the Font Lock cache for the current buffer.
The following criteria must be met for a Font Lock cache file to be read:
- Fast Lock mode must be turned on in the buffer.
- The buffer must not be modified.
- The buffer's font-lock-keywords must match the cache's.
- The buffer file's timestamp must match the cache's.
- Criteria imposed by fast-lock-cache-directories.
See fast-lock-mode(var)/fast-lock-mode(fun).
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/fast-lock.el.gz
(defun fast-lock-read-cache ()
"Read the Font Lock cache for the current buffer.
The following criteria must be met for a Font Lock cache file to be read:
- Fast Lock mode must be turned on in the buffer.
- The buffer must not be modified.
- The buffer's `font-lock-keywords' must match the cache's.
- The buffer file's timestamp must match the cache's.
- Criteria imposed by `fast-lock-cache-directories'.
See `fast-lock-mode'."
(interactive)
(let ((directories fast-lock-cache-directories)
(modified (buffer-modified-p)) (inhibit-read-only t)
(fontified font-lock-fontified))
(set (make-local-variable 'font-lock-fontified) nil)
;; Keep trying directories until fontification is turned off.
(while (and directories (not font-lock-fontified))
(let ((directory (fast-lock-cache-directory (car directories) nil)))
(condition-case nil
(when directory
(setq fast-lock-cache-filename (fast-lock-cache-name directory))
(when (file-readable-p fast-lock-cache-filename)
(load fast-lock-cache-filename t t t)))
(error nil) (quit nil))
(setq directories (cdr directories))))
;; Unset `fast-lock-cache-filename', and restore `font-lock-fontified', if
;; we don't use a cache. (Note that `fast-lock-cache-data' sets the value
;; of `fast-lock-cache-timestamp'.)
(set-buffer-modified-p modified)
(unless font-lock-fontified
(setq fast-lock-cache-filename nil font-lock-fontified fontified))))