diff options
Diffstat (limited to 'doc/lispref/loading.texi')
-rw-r--r-- | doc/lispref/loading.texi | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 22f0dde593a..4d683da1ad3 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -71,7 +71,11 @@ forms in it, and closes the file. To find the file, @code{load} first looks for a file named @file{@var{filename}.elc}, that is, for a file whose name is @var{filename} with the extension @samp{.elc} appended. If such a -file exists, it is loaded. If there is no file by that name, then +file exists, and Emacs was compiled with native-compilation support +(@pxref{Native Compilation}), @code{load} attempts to find a +corresponding @samp{.eln} file, and if found, loads it instead of +@file{@var{filename}.elc}. Otherwise, it loads +@file{@var{filename}.elc}. If there is no file by that name, then @code{load} looks for a file named @file{@var{filename}.el}. If that file exists, it is loaded. If Emacs was compiled with support for dynamic modules (@pxref{Dynamic Modules}), @code{load} next looks for @@ -109,6 +113,8 @@ explicit directory name. If the option @code{load-prefer-newer} is non-@code{nil}, then when searching suffixes, @code{load} selects whichever version of a file (@samp{.elc}, @samp{.el}, etc.)@: has been modified most recently. +In this case, @code{load} doesn't load the @samp{.eln} +natively-compiled file even if it exists. If @var{filename} is a relative file name, such as @file{foo} or @file{baz/foo.bar}, @code{load} searches for the file using the variable @@ -153,7 +159,8 @@ during compilation. @xref{Compiling Macros}. Messages like @samp{Loading foo...} and @samp{Loading foo...done} appear in the echo area during loading unless @var{nomessage} is -non-@code{nil}. +non-@code{nil}. If a natively-compiled @samp{.eln} file is loaded, +the message says so. @cindex load errors Any unhandled errors while loading a file terminate loading. If the @@ -430,6 +437,28 @@ optional argument @code{stringp} is non-@code{nil}, it instead returns the shadowed files as a string. @end deffn + If Emacs was compiled with support for native compilation +(@pxref{Native Compilation}), then when a @samp{.elc} byte-compiled +file is found by searching @code{load-path}, Emacs will try to look +for a corresponding @samp{.eln} file holding the corresponding +natively-compiled code. The natively-compiled files are looked up in +the directories listed by the @code{native-comp-eln-load-path}. + +@vindex comp-native-version-dir +@defvar native-comp-eln-load-path +This variable holds a list of directories where Emacs looks for +natively-compiled @samp{.eln} files. File names in the list that are +not absolute are interpreted as relative to @code{invocation-directory} +(@pxref{System Environment}). The last directory in the list is the +system directory, i.e.@: the directory with @samp{.eln} files +installed by the Emacs build and installation procedure. In each of +the directories in the list, Emacs looks for @samp{.eln} files in a +subdirectory whose name is constructed from the Emacs version and an +8-character hash that depends on the current native-compilation +@acronym{ABI}; the name of this subdirectory is stored in the variable +@code{comp-native-version-dir}. +@end defvar + @node Loading Non-ASCII @section Loading Non-@acronym{ASCII} Characters @cindex loading, and non-ASCII characters @@ -510,6 +539,9 @@ specification is not given here; it's not needed unless the user actually calls @var{function}, and when that happens, it's time to load the real definition. +If @var{interactive} is a list, it is interpreted as a list of modes +this command is applicable for. + You can autoload macros and keymaps as well as ordinary functions. Specify @var{type} as @code{macro} if @var{function} is really a macro. Specify @var{type} as @code{keymap} if @var{function} is really a @@ -1049,7 +1081,6 @@ rather than replacing that element. @xref{Eval}. @section Unloading @cindex unloading packages -@c Emacs 19 feature You can discard the functions and variables loaded by a library to reclaim memory for other Lisp objects. To do this, use the function @code{unload-feature}: @@ -1125,7 +1156,7 @@ You don't need to give a directory or extension in the file name @var{library}. Normally, you just give a bare file name, like this: @example -(with-eval-after-load "edebug" (def-edebug-spec c-point t)) +(with-eval-after-load "js" (define-key js-mode-map "\C-c\C-c" 'js-eval)) @end example To restrict which files can trigger the evaluation, include a |