Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
3367:84ee3ca77e7f | 3368:959746c534f6 |
---|---|
39 | 39 |
40 (defun symbol-file (sym) | 40 (defun symbol-file (sym) |
41 "Return the input source from which SYM was loaded. | 41 "Return the input source from which SYM was loaded. |
42 This is a file name, or nil if the source was a buffer with no associated file." | 42 This is a file name, or nil if the source was a buffer with no associated file." |
43 (interactive "SFind source file for symbol: ") ; XEmacs | 43 (interactive "SFind source file for symbol: ") ; XEmacs |
44 (dolist (entry load-history) | 44 (block look-up-symbol-file |
45 (when (memq sym (cdr entry)) | 45 (dolist (entry load-history) |
46 (return (car entry))))) | 46 (when (memq sym (cdr entry)) |
47 (return-from look-up-symbol-file (car entry)))) | |
48 (when (or (and (boundp sym) (built-in-variable-type sym)) | |
49 (and (fboundp sym) (subrp (symbol-function sym)))) | |
50 (let ((built-in-file (built-in-symbol-file sym))) | |
51 (if built-in-file | |
52 (concat build-root "/src/" built-in-file)))))) | |
47 | 53 |
48 (defun feature-symbols (feature) | 54 (defun feature-symbols (feature) |
49 "Return the file and list of symbols associated with a given FEATURE." | 55 "Return the file and list of symbols associated with a given FEATURE." |
50 (let ((pair `(provide . ,feature))) | 56 (let ((pair `(provide . ,feature))) |
51 (dolist (entry load-history) | 57 (dolist (entry load-history) |