Function: semantic-dependency-find-file-on-path

semantic-dependency-find-file-on-path is a byte-compiled function defined in dep.el.gz.

Signature

(semantic-dependency-find-file-on-path FILE SYSTEMP &optional MODE)

Documentation

Return an expanded file name for FILE on available paths.

If SYSTEMP is true, then only search system paths. If optional argument MODE is non-nil, then derive paths from the provided mode, not from the current major mode.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/dep.el.gz
(defun semantic-dependency-find-file-on-path (file systemp &optional mode)
  "Return an expanded file name for FILE on available paths.
If SYSTEMP is true, then only search system paths.
If optional argument MODE is non-nil, then derive paths from the
provided mode, not from the current major mode."
  (if (not mode) (setq mode major-mode))
  (let ((sysp (mode-local-value
	       mode 'semantic-dependency-system-include-path))
	(edesys (when (and (featurep 'ede) ede-minor-mode
			   ede-object)
		  (ede-system-include-path
		   (if (listp ede-object) (car ede-object) ede-object))))
	(locp (mode-local-value
	       mode 'semantic-dependency-include-path))
	(found nil))
    (when (file-exists-p file)
      (setq found file))
    (when (and (not found) (not systemp))
      (setq found (locate-file file locp)))
    (when (and (not found) edesys)
      (setq found (locate-file file edesys)))
    (when (not found)
      (setq found (locate-file file sysp)))
    (if found (expand-file-name found))))