Function: vhdl-subprog-paste-call
vhdl-subprog-paste-call is an interactive and byte-compiled function
defined in vhdl-mode.el.gz.
Signature
(vhdl-subprog-paste-call)
Documentation
Paste as a subprogram call.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-subprog-paste-call ()
"Paste as a subprogram call."
(interactive)
(if (not vhdl-subprog-list)
(error "ERROR: No subprogram interface read")
(let ((orig-vhdl-subprog-list vhdl-subprog-list)
param-list margin list-margin param start)
;; flatten local copy of interface list (must be flat for parameter mapping)
(vhdl-subprog-flatten)
(setq param-list (nth 2 vhdl-subprog-list))
(indent-according-to-mode)
(setq margin (current-indentation))
(message "Pasting interface as subprogram call \"%s\"..."
(car vhdl-subprog-list))
;; paste name
(insert (nth 0 vhdl-subprog-list))
(if (not param-list)
(insert ";")
(setq start (point))
;; paste parameter list
(insert " (")
(unless vhdl-argument-list-indent
(insert "\n") (indent-to (+ margin vhdl-basic-offset)))
(setq list-margin (current-column))
(while param-list
(setq param (car param-list))
;; paste group comment and spacing
(when (eq vhdl-include-group-comments 'always)
(vhdl-paste-group-comment (nth 6 param) list-margin))
;; paste formal port
(insert (car (nth 0 param)) " => ")
(setq param-list (cdr param-list))
(insert (if param-list "," ");"))
;; paste comment
(when (and vhdl-include-port-comments (nth 5 param))
(vhdl-comment-insert-inline (nth 5 param)))
(when param-list (insert "\n") (indent-to list-margin)))
;; align parameter list
(when vhdl-auto-align
(vhdl-align-region-groups start (point) 1)))
(message "Pasting interface as subprogram call \"%s\"...done"
(car vhdl-subprog-list))
(setq vhdl-subprog-list orig-vhdl-subprog-list))))