1. xemacs
  2. xemacs-devel


sperber-guest  committed 3e4cb6a Merge

Deal better with #'builtin-symbol-file returning full paths, find-func.el

  • Participants
  • Parent commits 73d7473, 9135e70
  • Branches default

Comments (0)

Files changed (2)

File ChangeLog

View file
  • Ignore whitespace
+2011-01-08  Aidan Kehoe  <kehoea@parhasard.net>
+	* find-func.el (find-function-C-source):
+	Deal better with #'builtin-symbol-file returning full paths in
+	this function; check for readability of
+	find-function-C-source-directory.
 2010-02-11  Norbert Koch  <viteno@xemacs.org>
 	* Makefile (VERSION): XEmacs package 1.80 released.

File find-func.el

View file
  • Ignore whitespace
 (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)))