Function: fast-lock-cache-data

fast-lock-cache-data is a byte-compiled function defined in fast-lock.el.gz.

Signature

(fast-lock-cache-data VERSION TIMESTAMP SYNTACTIC-KEYWORDS SYNTACTIC-PROPERTIES KEYWORDS FACE-PROPERTIES &rest IGNORED)

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/fast-lock.el.gz
(defun fast-lock-cache-data (version timestamp
			     syntactic-keywords syntactic-properties
			     keywords face-properties
			     &rest _ignored)
  ;; Find value of syntactic keywords in case it is a symbol.
  (setq font-lock-syntactic-keywords (font-lock-eval-keywords
				      font-lock-syntactic-keywords))
  ;; Compile all keywords in case some are and some aren't.
  (when font-lock-syntactic-keywords
    (setq font-lock-syntactic-keywords (font-lock-compile-keywords
					font-lock-syntactic-keywords t)))
  (when syntactic-keywords
    (setq syntactic-keywords (font-lock-compile-keywords syntactic-keywords t)))
  (setq font-lock-keywords (font-lock-compile-keywords font-lock-keywords)
	keywords (font-lock-compile-keywords keywords))
  ;; Use the Font Lock cache SYNTACTIC-PROPERTIES and FACE-PROPERTIES if we're
  ;; using cache VERSION format 3, the current buffer's file timestamp matches
  ;; the TIMESTAMP, the current buffer's `font-lock-syntactic-keywords' are the
  ;; same as SYNTACTIC-KEYWORDS, and the current buffer's `font-lock-keywords'
  ;; are the same as KEYWORDS.
  (let ((buf-timestamp (visited-file-modtime))
	(verbose (if (numberp fast-lock-verbose)
		     (> (buffer-size) fast-lock-verbose)
		   fast-lock-verbose))
	(loaded t))
    (if (or (/= version 3)
	    (buffer-modified-p)
	    (not (equal timestamp buf-timestamp))
	    (not (equal syntactic-keywords font-lock-syntactic-keywords))
	    (not (equal keywords font-lock-keywords)))
	(setq loaded nil)
      (with-temp-message
	  (when verbose
	    (format "Loading %s font lock cache..." (buffer-name)))
	(condition-case nil
	    (fast-lock-add-properties syntactic-properties face-properties)
	  (error (setq loaded 'error)) (quit (setq loaded 'quit))))
      (cond ((eq loaded 'quit)
	     (message "Loading %s font lock cache...quit" (buffer-name)))
	    ((eq loaded 'error)
	     (message "Loading %s font lock cache...failed" (buffer-name)))))
    (setq font-lock-fontified (eq loaded t)
	  fast-lock-cache-timestamp (and (eq loaded t) timestamp))))