diff options
Diffstat (limited to 'devdocs/elisp/where-defined.html')
| -rw-r--r-- | devdocs/elisp/where-defined.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/devdocs/elisp/where-defined.html b/devdocs/elisp/where-defined.html new file mode 100644 index 00000000..c16bb03c --- /dev/null +++ b/devdocs/elisp/where-defined.html @@ -0,0 +1,14 @@ + <h3 class="section">Which File Defined a Certain Symbol</h3> <dl> <dt id="symbol-file">Function: <strong>symbol-file</strong> <em>symbol &optional type</em> +</dt> <dd> +<p>This function returns the name of the file that defined <var>symbol</var>. If <var>type</var> is <code>nil</code>, then any kind of definition is acceptable. If <var>type</var> is <code>defun</code>, <code>defvar</code>, or <code>defface</code>, that specifies function definition, variable definition, or face definition only. </p> <p>The value is normally an absolute file name. It can also be <code>nil</code>, if the definition is not associated with any file. If <var>symbol</var> specifies an autoloaded function, the value can be a relative file name without extension. </p> +</dd> +</dl> <p>The basis for <code>symbol-file</code> is the data in the variable <code>load-history</code>. </p> <dl> <dt id="load-history">Variable: <strong>load-history</strong> +</dt> <dd> +<p>The value of this variable is an alist that associates the names of loaded library files with the names of the functions and variables they defined, as well as the features they provided or required. </p> <p>Each element in this alist describes one loaded library (including libraries that are preloaded at startup). It is a list whose <small>CAR</small> is the absolute file name of the library (a string). The rest of the list elements have these forms: </p> <dl compact> <dt><code><var>var</var></code></dt> <dd><p>The symbol <var>var</var> was defined as a variable. </p></dd> <dt><code>(defun . <var>fun</var>)</code></dt> <dd><p>The function <var>fun</var> was defined. </p></dd> <dt><code>(t . <var>fun</var>)</code></dt> <dd><p>The function <var>fun</var> was previously an autoload before this library redefined it as a function. The following element is always <code>(defun . <var>fun</var>)</code>, which represents defining <var>fun</var> as a function. </p></dd> <dt><code>(autoload . <var>fun</var>)</code></dt> <dd><p>The function <var>fun</var> was defined as an autoload. </p></dd> <dt><code>(defface . <var>face</var>)</code></dt> <dd><p>The face <var>face</var> was defined. </p></dd> <dt><code>(require . <var>feature</var>)</code></dt> <dd><p>The feature <var>feature</var> was required. </p></dd> <dt><code>(provide . <var>feature</var>)</code></dt> <dd><p>The feature <var>feature</var> was provided. </p></dd> <dt><code>(cl-defmethod <var>method</var> <var>specializers</var>)</code></dt> <dd><p>The named <var>method</var> was defined by using <code>cl-defmethod</code>, with <var>specializers</var> as its specializers. </p></dd> <dt><code>(define-type . <var>type</var>)</code></dt> <dd><p>The type <var>type</var> was defined. </p></dd> </dl> <p>The value of <code>load-history</code> may have one element whose <small>CAR</small> is <code>nil</code>. This element describes definitions made with <code>eval-buffer</code> on a buffer that is not visiting a file. </p> +</dd> +</dl> <p>The command <code>eval-region</code> updates <code>load-history</code>, but does so by adding the symbols defined to the element for the file being visited, rather than replacing that element. See <a href="eval">Eval</a>. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Where-Defined.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Where-Defined.html</a> + </p> +</div> |
