[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

15.8 Which File Defined a Certain Symbol

Function: symbol-file symbol &optional type

This function returns the name of the file that defined symbol. If type is nil, then any kind of definition is acceptable. If type is defun or defvar, that specifies function definition only or variable definition only.

The value is normally an absolute file name. It can also be nil, if the definition is not associated with any file.

The basis for symbol-file is the data in the variable load-history.

Variable: load-history

This variable's value is an alist connecting library file names with the names of functions and variables they define, the features they provide, and the features they require.

Each element is a list and describes one library. The CAR of the list is the absolute file name of the library, as a string. The rest of the list elements have these forms:

var

The symbol var was defined as a variable.

(defun . fun)

The function fun was defined.

(t . fun)

The function fun was previously an autoload before this library redefined it as a function. The following element is always (defun . fun), which represents defining fun as a function.

(autoload . fun)

The function fun was defined as an autoload.

(require . feature)

The feature feature was required.

(provide . feature)

The feature feature was provided.

The value of load-history may have one element whose CAR is nil. This element describes definitions made with eval-buffer on a buffer that is not visiting a file.

The command eval-region updates load-history, but does so by adding the symbols defined to the element for the file being visited, rather than replacing that element. Voir la section Eval.


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.