Function: verilog-module-inside-filename-p

verilog-module-inside-filename-p is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-module-inside-filename-p MODULE FILENAME)

Documentation

Return modi if MODULE is specified inside FILENAME, else nil.

Allows version control to check out the file if need be.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
;;; Module name lookup:
;;

(defun verilog-module-inside-filename-p (module filename)
  "Return modi if MODULE is specified inside FILENAME, else nil.
Allows version control to check out the file if need be."
  (and (or (file-exists-p filename)
	   (and (fboundp 'vc-backend)
		(vc-backend filename)))
       (let (modi type)
	 (with-current-buffer (find-file-noselect filename)
	   (save-excursion
	     (goto-char (point-min))
	     (while (and
		     ;; It may be tempting to look for verilog-defun-re,
		     ;; don't, it slows things down a lot!
                    (verilog-re-search-forward-quick "\\<\\(connectmodule\\|module\\|interface\\|program\\)\\>" nil t)
		     (setq type (match-string-no-properties 0))
		     (verilog-re-search-forward-quick "[(;]" nil t))
	       (if (equal module (verilog-read-module-name))
		   (setq modi (verilog-modi-new module filename (point) type))))
	     modi)))))