Function: verilog-beg-of-defun

verilog-beg-of-defun is an interactive and byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-beg-of-defun)

Documentation

Move backward to the beginning of the current function or procedure.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-beg-of-defun ()
  "Move backward to the beginning of the current function or procedure."
  (interactive)
  (let (found)
    (save-excursion
      (when (verilog-looking-back verilog-defun-tf-re-end (point-at-bol))
        (verilog-backward-sexp)
        (setq found (point)))
      (while (and (not found)
                  (verilog-re-search-backward verilog-defun-tf-re-all nil t))
        (cond ((verilog-looking-back "\\(\\<typedef\\>\\s-+\\)" (point-at-bol)) ; corner case, e.g. 'typedef class <id>;'
               (backward-word))
              ((looking-at verilog-defun-tf-re-end)
               (verilog-backward-sexp))
              ((looking-at verilog-defun-tf-re-beg)
               (setq found (point))))))
    (when found
      (goto-char found))))