Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
23852:dc812cd8bd1b | 23853:e9fe8ed71303 |
---|---|
539 (let ((obj (read (current-buffer)))) | 539 (let ((obj (read (current-buffer)))) |
540 (and (symbolp obj) (fboundp obj) obj))) | 540 (and (symbolp obj) (fboundp obj) obj))) |
541 (error nil))) | 541 (error nil))) |
542 (set-syntax-table stab)))) | 542 (set-syntax-table stab)))) |
543 | 543 |
544 (defun describe-function-find-file (function) | 544 (defvar symbol-file-load-history-loaded nil |
545 "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'. | |
546 That file records the part of `load-history' for preloaded files, | |
547 which is cleared out before dumping to make Emacs smaller.") | |
548 | |
549 (defun symbol-file (function) | |
550 "Return the input source from which SYM was loaded. | |
551 The value is normally a string that was passed to `load': | |
552 either an absolute file name, or a library name | |
553 \(with no directory name and no `.el' or `.elc' at the end). | |
554 It can also be nil, if the definition is not associated with any file." | |
555 (unless symbol-file-load-history-loaded | |
556 (load (expand-file-name | |
557 ;; fns-XX.YY.ZZ.el does not work on DOS filesystem. | |
558 (if (eq system-type 'ms-dos) | |
559 "fns.el" | |
560 (format "fns-%s.el" emacs-version)) | |
561 exec-directory) | |
562 ;; The file name fns-%s.el already has a .el extension. | |
563 nil nil t) | |
564 (setq symbol-file-load-history-loaded t)) | |
545 (let ((files load-history) | 565 (let ((files load-history) |
546 file functions) | 566 file functions) |
547 (while files | 567 (while files |
548 (if (memq function (cdr (car files))) | 568 (if (memq function (cdr (car files))) |
549 (setq file (car (car files)) files nil)) | 569 (setq file (car (car files)) files nil)) |
608 (when (and parens (not (equal string ""))) | 628 (when (and parens (not (equal string ""))) |
609 (setq need-close t) | 629 (setq need-close t) |
610 (princ "(")) | 630 (princ "(")) |
611 (princ string) | 631 (princ string) |
612 (or file-name | 632 (or file-name |
613 (setq file-name (describe-function-find-file function))) | 633 (setq file-name (symbol-file function))) |
614 (if file-name | 634 (if file-name |
615 (progn | 635 (progn |
616 (princ " in `") | 636 (princ " in `") |
617 ;; We used to add .el to the file name, | 637 ;; We used to add .el to the file name, |
618 ;; but that's completely wrong when the user used load-file. | 638 ;; but that's completely wrong when the user used load-file. |
747 (customize-variable v)) variable) | 767 (customize-variable v)) variable) |
748 )))) | 768 )))) |
749 ;; Make a hyperlink to the library if appropriate. (Don't | 769 ;; Make a hyperlink to the library if appropriate. (Don't |
750 ;; change the format of the buffer's initial line in case | 770 ;; change the format of the buffer's initial line in case |
751 ;; anything expects the current format.) | 771 ;; anything expects the current format.) |
752 (let ((file-name (describe-function-find-file variable))) | 772 (let ((file-name (symbol-file variable))) |
753 (when file-name | 773 (when file-name |
754 (princ "\n\nDefined in `") | 774 (princ "\n\nDefined in `") |
755 (princ file-name) | 775 (princ file-name) |
756 (princ "'.") | 776 (princ "'.") |
757 (with-current-buffer "*Help*" | 777 (with-current-buffer "*Help*" |