Function: verilog--auto-inst-first

verilog--auto-inst-first is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog--auto-inst-first INDENT-PT SECTION)

Documentation

Insert , and SECTION before port, as part of M-x verilog-auto-inst (verilog-auto-inst).

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog--auto-inst-first (indent-pt section)
  "Insert , and SECTION before port, as part of \\[verilog-auto-inst]."
  ;; Do we need a trailing comma?
  ;; There maybe an ifdef or something similar before us.  What a mess.  Thus
  ;; to avoid trouble we only insert on preceding ) or *.
  ;; Insert first port on new line
  (when verilog-auto-inst-first-any
    (setq verilog-auto-inst-first-any nil)
    (insert "\n")  ; Must insert before search, so point will move forward if insert comma
    (save-excursion
      (verilog-re-search-backward-quick "[^ \t\n\f]" nil nil)
      (when (looking-at ")\\|\\*")  ; Generally don't insert, unless we are fairly sure
        (forward-char 1)
        (insert ","))))
  (when verilog-auto-inst-first-section
    (setq verilog-auto-inst-first-section nil)
    (verilog-insert-indent section)))