Function: gnus-cache-file-contents

gnus-cache-file-contents is a byte-compiled function defined in gnus-util.el.gz.

Signature

(gnus-cache-file-contents FILE VARIABLE FUNCTION)

Documentation

Cache the contents of FILE in VARIABLE. The contents come from FUNCTION.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-util.el.gz
(defun gnus-cache-file-contents (file variable function)
  "Cache the contents of FILE in VARIABLE.  The contents come from FUNCTION."
  (let ((time (file-attribute-modification-time (file-attributes file)))
	contents value)
    (if (or (null (setq value (symbol-value variable)))
	    (not (equal (car value) file))
	    (not (time-equal-p (nth 1 value) time)))
	(progn
	  (setq contents (funcall function file))
	  (set variable (list file time contents))
	  contents)
      (nth 2 value))))