Function: cedet-cscope-expand-filename

cedet-cscope-expand-filename is an interactive and byte-compiled function defined in cedet-cscope.el.gz.

Signature

(cedet-cscope-expand-filename FILENAME)

Documentation

Expand the FILENAME with CScope.

Return a fully qualified filename.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/cedet-cscope.el.gz
(defun cedet-cscope-expand-filename (filename)
  "Expand the FILENAME with CScope.
Return a fully qualified filename."
  (interactive "sFile: ")
  (let* ((ans1 (with-current-buffer
                   (cedet-cscope-call (list "-d" "-L" "-7" filename))
		 (goto-char (point-min))
		 (if (looking-at "[^ \n]*cscope: ")
		     (error "CScope not available")
		   (split-string (buffer-string) "\n" t))))
	 (ans2 (mapcar (lambda (hit)
			 (expand-file-name (car (split-string hit " "))))
		       ans1)))
    (when (called-interactively-p 'interactive)
      (if ans2
	  (if (= (length ans2) 1)
	      (message "%s" (car ans2))
	    (message "%s + %d others" (car ans2)
		     (length (cdr ans2))))
	(error "No file found")))
    ans2))