Function: vhdl-template-context
vhdl-template-context is an interactive and byte-compiled function
defined in vhdl-mode.el.gz.
Signature
(vhdl-template-context)
Documentation
Insert a context declaration.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-template-context ()
"Insert a context declaration."
(interactive)
(let ((margin (current-indentation))
(start (point))
name position) ;; entity-exists string
(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))))