+(defun vhdl-template-context ()
+ "Insert a context declaration."
+ (interactive)
+ (let ((margin (current-indentation))
+ (start (point))
+ entity-exists string name position)
+ (vhdl-insert-keyword "CONTEXT ")
+ (when (setq name (vhdl-template-field "name" nil t start (point)))
+ (vhdl-insert-keyword " IS\n")
+ (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))
+ (indent-to (+ margin vhdl-basic-offset))
+ (setq position (point))
+ (insert "\n")
+ (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))
+ (indent-to margin)
+ (vhdl-insert-keyword "END ")
+ (unless (vhdl-standard-p '87)
+ (vhdl-insert-keyword "CONTEXT "))
+ (insert name ";")
+ (goto-char position))))
+