Function: verilog-goto-defun
verilog-goto-defun is an interactive and byte-compiled function
defined in verilog-mode.el.gz.
Signature
(verilog-goto-defun)
Documentation
Move to specified Verilog module/interface/task/function.
The default is a name found in the buffer around point.
If search fails, other files are checked based on
verilog-library-flags.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-goto-defun ()
"Move to specified Verilog module/interface/task/function.
The default is a name found in the buffer around point.
If search fails, other files are checked based on
`verilog-library-flags'."
(interactive)
(let* ((default (verilog-get-default-symbol))
;; The following variable is used in verilog-comp-function
(verilog-buffer-to-use (current-buffer))
(label
(completing-read (cond ((fboundp 'format-prompt)
;; `format-prompt' is new in Emacs 28.1.
(format-prompt "Goto-Label" default))
((not (string= default ""))
(concat "Goto-Label (default " default "): "))
(t "Goto-Label: "))
#'verilog-comp-defun nil nil ""))
pt)
;; Make sure library paths are correct, in case need to resolve module
(verilog-auto-reeval-locals)
(verilog-getopt-flags)
;; If there was no response on prompt, use default value
(if (string= label "")
(setq label default))
;; Goto right place in buffer if label is not an empty string
(or (string= label "")
(progn
(save-excursion
(goto-char (point-min))
(setq pt
(re-search-forward (verilog-build-defun-re label t) nil t)))
(when pt
(goto-char pt)
(beginning-of-line))
pt)
(verilog-goto-defun-file label))))