diff lisp/loadhist.el @ 3368:959746c534f6

[xemacs-hg @ 2006-04-29 16:15:21 by aidan] Support builtin functions in find-function.
author aidan
date Sat, 29 Apr 2006 16:15:31 +0000
parents 184461bc8de4
children 1ee424086c62
line wrap: on
line diff
--- a/lisp/loadhist.el	Sat Apr 29 14:36:57 2006 +0000
+++ b/lisp/loadhist.el	Sat Apr 29 16:15:31 2006 +0000
@@ -41,9 +41,15 @@
   "Return the input source from which SYM was loaded.
 This is a file name, or nil if the source was a buffer with no associated file."
   (interactive "SFind source file for symbol: ") ; XEmacs
-  (dolist (entry load-history)
-    (when (memq sym (cdr entry))
-      (return (car entry)))))
+  (block look-up-symbol-file
+    (dolist (entry load-history)
+      (when (memq sym (cdr entry))
+	(return-from look-up-symbol-file (car entry))))
+    (when (or (and (boundp sym) (built-in-variable-type sym))
+	      (and (fboundp sym) (subrp (symbol-function sym))))
+      (let ((built-in-file (built-in-symbol-file sym)))
+	(if built-in-file
+	    (concat build-root "/src/" built-in-file))))))
 
 (defun feature-symbols (feature)
   "Return the file and list of symbols associated with a given FEATURE."