Function: vhdl-load-cache

vhdl-load-cache is a byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-load-cache KEY)

Documentation

Load hierarchy cache information from file.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-load-cache (key)
  "Load hierarchy cache information from file."
  (let* ((vhdl-project key)
	 (default-directory key)
	 (directory (vhdl-default-directory))
	 (file-name (vhdl-resolve-env-variable
		     (vhdl-replace-string
		      (cons "\\(.*\\) \\(.*\\)" vhdl-speedbar-cache-file-name)
		      (concat
		       (subst-char-in-string ?  ?_ (or (vhdl-project-p) "dir"))
		       " " (user-login-name)))))
	 (file-dir-name (expand-file-name file-name directory))
	 vhdl-cache-version)
    (unless (memq 'vhdl-save-caches kill-emacs-hook)
      (add-hook 'kill-emacs-hook #'vhdl-save-caches))
    (when (file-exists-p file-dir-name)
      (condition-case ()
	  (progn (load-file file-dir-name)
		 (string< (mapconcat
			   (lambda (a) (format "%3d" (string-to-number a)))
			   (split-string "3.33" "\\.") "")
			  (mapconcat
			   (lambda (a) (format "%3d" (string-to-number a)))
			   (split-string vhdl-cache-version "\\.") "")))
	(error (progn (vhdl-warning (format "ERROR:  Corrupted cache file: \"%s\"" file-dir-name))
		      nil))))))