Source

xemacs-devel / find-func.el

Diff from to

find-func.el

 (defun find-function-C-source (fun-or-var file type)
   "Find the source location where SUBR-OR-VAR is defined in FILE.
 TYPE should be nil to find a function, or `defvar' to find a variable."
-  (unless find-function-C-source-directory
+  (unless (and find-function-C-source-directory
+	       (file-readable-p find-function-C-source-directory))
     (setq find-function-C-source-directory
 	  (read-directory-name "XEmacs C source dir: " nil nil t)))
   (setq file (expand-file-name file find-function-C-source-directory))
+  (or (file-readable-p file)
+      (equal (file-name-directory file) find-function-C-source-directory)
+      (setq file (expand-file-name (file-name-nondirectory file)
+                                   find-function-C-source-directory)))
   (unless (file-readable-p file)
     (error "The C source file %s is not available"
 	   (file-name-nondirectory file)))