Function: verilog-get-lineup-indent-2

verilog-get-lineup-indent-2 is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-get-lineup-indent-2 REGEXP BEG END)

Documentation

Return the indent level that will line up several lines.

The lineup string is searched using REGEXP within the region between points BEG and END.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-get-lineup-indent-2 (regexp beg end)
  "Return the indent level that will line up several lines.
The lineup string is searched using REGEXP within the region between points
BEG and END."
  (save-excursion
    (let ((ind 0))
      (goto-char beg)
      (beginning-of-line)
      ;; Get rightmost position
      (while (< (point) end)
	(when (and (verilog-re-search-forward regexp end 'move)
                   (not (verilog-in-attribute-p))) ; skip attribute exprs
	  (goto-char (match-beginning 2))
          (skip-chars-backward " \t")
	  (if (> (current-column) ind)
	      (setq ind (current-column)))
	  (goto-char (match-end 0))))
      (setq ind (if (> ind 0)
                    (1+ ind)
                  ;; No lineup-string found
                  (goto-char beg)
                  (end-of-line)
                  (skip-chars-backward " \t")
                  (1+ (current-column))))
      ind)))