Function: vhdl-template-standard-package

vhdl-template-standard-package is a byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-template-standard-package LIBRARY PACKAGE)

Documentation

Insert specification of a standard package.

Include a library specification, if not already there.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-template-standard-package (library package)
  "Insert specification of a standard package.
Include a library specification, if not already there."
  (let ((margin (current-indentation)))
    (unless (equal library "std")
      (unless (or (save-excursion
		    (vhdl-prepare-search-1
		     (and (not (bobp))
			  (re-search-backward
			   (concat "^\\s-*\\(\\(library\\)\\s-+\\(\\w+\\s-*,\\s-*\\)*"
				   library "\\|end\\)\\>")
			   nil t)
			  (match-string 2))))
		  (equal (downcase library) "work"))
	(vhdl-insert-keyword "LIBRARY ")
	(insert library ";")
	(when package
	  (insert "\n")
	  (indent-to margin))))
    (when package
      (vhdl-insert-keyword "USE ")
      (insert library "." package)
      (vhdl-insert-keyword ".ALL;"))))