diff lisp/help.el @ 23853:e9fe8ed71303

(symbol-file-load-history-loaded): Variable renamed, and defvar moved from loadhist.el. (symbol-file): Renamed from describe-function-find-file. Load fns-VERSION.el here. (describe-variable, describe-function-1): Use symbol-file.
author Karl Heuer <kwzh@gnu.org>
date Thu, 10 Dec 1998 03:25:33 +0000
parents 19e467700712
children 81d1dacd379e
line wrap: on
line diff
--- a/lisp/help.el	Thu Dec 10 03:25:15 1998 +0000
+++ b/lisp/help.el	Thu Dec 10 03:25:33 1998 +0000
@@ -541,7 +541,27 @@
 	      (error nil)))
       (set-syntax-table stab))))
 
-(defun describe-function-find-file (function)
+(defvar symbol-file-load-history-loaded nil
+  "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
+That file records the part of `load-history' for preloaded files,
+which is cleared out before dumping to make Emacs smaller.")
+
+(defun symbol-file (function)
+  "Return the input source from which SYM was loaded.
+The value is normally a string that was passed to `load':
+either an absolute file name, or a library name
+\(with no directory name and no `.el' or `.elc' at the end).
+It can also be nil, if the definition is not associated with any file."
+  (unless symbol-file-load-history-loaded
+    (load (expand-file-name
+	   ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
+	   (if (eq system-type 'ms-dos)
+	       "fns.el"
+	     (format "fns-%s.el" emacs-version))
+	   exec-directory)
+	  ;; The file name fns-%s.el already has a .el extension.
+	  nil nil t)
+    (setq symbol-file-load-history-loaded t))
   (let ((files load-history)
 	file functions)
     (while files
@@ -610,7 +630,7 @@
       (princ "("))
     (princ string)
     (or file-name
-	(setq file-name (describe-function-find-file function)))
+	(setq file-name (symbol-file function)))
     (if file-name
 	(progn
 	  (princ " in `")
@@ -749,7 +769,7 @@
 	  ;; Make a hyperlink to the library if appropriate.  (Don't
 	  ;; change the format of the buffer's initial line in case
 	  ;; anything expects the current format.)
-	  (let ((file-name (describe-function-find-file variable)))
+	  (let ((file-name (symbol-file variable)))
 	    (when file-name
 	      (princ "\n\nDefined in `")
 	      (princ file-name)