Function: filesets-menu-cache-file-save-maybe

filesets-menu-cache-file-save-maybe is a byte-compiled function defined in filesets.el.gz.

Signature

(filesets-menu-cache-file-save-maybe &optional SIMPLY-DO-IT)

Documentation

Write filesets' cache file.

If SIMPLY-DO-IT is non-nil, the cache file will be written no matter if fileset thinks this is necessary or not.

Source Code

;; Defined in /usr/src/emacs/lisp/filesets.el.gz
(defun filesets-menu-cache-file-save-maybe (&optional simply-do-it)
  "Write filesets' cache file.
If SIMPLY-DO-IT is non-nil, the cache file will be written no matter if
fileset thinks this is necessary or not."
  (when (and (not (equal filesets-menu-cache-file ""))
	     (or simply-do-it
		 filesets-update-cache-file-flag))
    (when (file-exists-p filesets-menu-cache-file)
      (delete-file filesets-menu-cache-file))
    ;;(message "Filesets: saving menu cache")
    (with-temp-buffer
      (insert ";; -*- mode: emacs-lisp; lexical-binding: t -*-\n")
      (dolist (this filesets-menu-cache-contents)
	(if (get this 'custom-type)
	    (progn
	      (insert (format "(setq-default %s '%S)" this (eval this t)))
	      (when filesets-menu-ensure-use-cached
		(newline)
		(insert (format "(setq %s (cons '%s %s))"
				'filesets-ignore-next-set-default
				this
				'filesets-ignore-next-set-default))))
	  (insert (format "(setq %s '%S)" this (eval this t))))
	(newline 2))
      (insert (format "(setq filesets-cache-version %S)" filesets-version))
      (newline 2)
      (when filesets-cache-hostname-flag
	(insert (format "(setq filesets-cache-hostname %S)" (system-name)))
	(newline 2))
      (run-hooks 'filesets-cache-fill-content-hook)
      (write-file filesets-menu-cache-file))
    (setq filesets-has-changed-flag nil)
    (setq filesets-update-cache-file-flag nil)))