Function: verilog-load-file-at-point

verilog-load-file-at-point is an interactive and byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-load-file-at-point &optional WARN)

Documentation

Load file under point.

If WARN, throw warning if not found. Files are checked based on verilog-library-flags.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
;; ffap isn't usable for Verilog mode. It uses library paths.
;; so define this function to do more or less the same as ffap
;; but first resolve filename...
(defun verilog-load-file-at-point (&optional warn)
  "Load file under point.
If WARN, throw warning if not found.
Files are checked based on `verilog-library-flags'."
  (interactive)
  (save-excursion  ; implement a Verilog specific ffap
    (let ((overlays (overlays-in (point) (point)))
	  hit)
      (while (and overlays (not hit))
	(when (overlay-get (car overlays) 'verilog-inst-module)
	  (verilog-goto-defun-file (buffer-substring
				    (overlay-start (car overlays))
				    (overlay-end (car overlays))))
	  (setq hit t))
	(setq overlays (cdr overlays)))
      ;; Include?
      (beginning-of-line)
      (when (and (not hit)
		 (looking-at verilog-include-file-regexp))
	(if (and (car (verilog-library-filenames
                       (match-string-no-properties 1)
                       (buffer-file-name)))
		 (file-readable-p (car (verilog-library-filenames
                                        (match-string-no-properties 1)
                                        (buffer-file-name)))))
	    (find-file (car (verilog-library-filenames
                             (match-string-no-properties 1)
                             (buffer-file-name))))
	  (when warn
	    (message
	     "File `%s' isn't readable, use shift-mouse2 to paste in this field"
	     (match-string 1))))))))