Function: vhdl-port-paste-port

vhdl-port-paste-port is a byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-port-paste-port)

Documentation

Paste a port clause.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-port-paste-port ()
  "Paste a port clause."
  (let ((margin (current-indentation))
	(port-list (nth 2 vhdl-port-list))
	list-margin start names port)
    ;; paste port clause
    (when port-list
      (setq start (point))
      (vhdl-insert-keyword "PORT (")
      (unless vhdl-argument-list-indent
	(insert "\n") (indent-to (+ margin vhdl-basic-offset)))
      (setq list-margin (current-column))
      (while port-list
	(setq port (car port-list))
	;; paste group comment and spacing
	(when (memq vhdl-include-group-comments '(decl always))
	  (vhdl-paste-group-comment (nth 5 port) list-margin))
	;; paste object
	(when (nth 1 port) (insert (nth 1 port) " "))
	;; paste names
	(setq names (nth 0 port))
	(while names
	  (insert (car names))
	  (setq names (cdr names))
	  (when names (insert ", ")))
	;; paste direction
	(insert " : ")
	(when (nth 2 port) (insert (nth 2 port) " "))
	;; paste type
	(insert (nth 3 port))
	(unless (cdr port-list) (insert ")"))
	(insert ";")
	;; paste comment
	(when (and vhdl-include-port-comments (nth 4 port))
	  (vhdl-comment-insert-inline (nth 4 port) t))
	(setq port-list (cdr port-list))
	(when port-list (insert "\n") (indent-to list-margin)))
      ;; align port clause
      (when vhdl-auto-align (vhdl-align-region-groups start (point) 1)))))