Function: vhdl-template-when

vhdl-template-when is an interactive and byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-template-when)

Documentation

Indent correctly if within a case statement.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-template-when ()
  "Indent correctly if within a case statement."
  (interactive)
  (let ((position (point))
	margin)
    (vhdl-prepare-search-2
     (if (and (= (current-column) (current-indentation))
	      (vhdl-re-search-forward "\\<end\\>" nil t)
	      (looking-at "\\s-*\\<case\\>"))
	 (progn
	   (setq margin (current-indentation))
	   (goto-char position)
	   (delete-horizontal-space)
	   (indent-to (+ margin vhdl-basic-offset)))
       (goto-char position)))
    (vhdl-insert-keyword "WHEN ")))