emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lispref/loading.texi


From: Luc Teirlinck
Subject: [Emacs-diffs] Changes to emacs/lispref/loading.texi
Date: Tue, 28 Feb 2006 03:01:57 +0000

Index: emacs/lispref/loading.texi
diff -u emacs/lispref/loading.texi:1.60 emacs/lispref/loading.texi:1.61
--- emacs/lispref/loading.texi:1.60     Mon Feb  6 11:55:10 2006
+++ emacs/lispref/loading.texi  Tue Feb 28 03:01:57 2006
@@ -36,6 +36,7 @@
 
 @menu
 * How Programs Do Loading:: The @code{load} function and others.
+* Load Suffixes::           Details about the suffixes that @code{load} tries.
 * Library Search::          Finding a library to load.
 * Loading Non-ASCII::       address@hidden characters in Emacs Lisp files.
 * Autoload::                Setting up a function to autoload.
@@ -72,17 +73,27 @@
 @var{filename}.  In the perverse case of a file named @file{foo.el.el},
 evaluation of @code{(load "foo.el")} will indeed find it.)
 
-If the optional argument @var{nosuffix} is address@hidden, then the
-suffixes @samp{.elc} and @samp{.el} are not tried.  In this case, you
-must specify the precise file name you want.  By specifying the precise
-file name and using @code{t} for @var{nosuffix}, you can prevent
-perverse file names such as @file{foo.el.el} from being tried.
+If Auto Compression mode is enabled, as it is by default, then
+if @code{load} can not find a file, it searches for a compressed
+version of the file before trying other file names.  It decompresses
+and loads it if it exists.  It looks for compressed versions by
+appending the suffixes in @code{jka-compr-load-suffixes} to the file
+name.  The value of this variable must be a list of strings. Its
+standard value is @code{(".gz")}.
+
+If the optional argument @var{nosuffix} is address@hidden, then
address@hidden does not try the suffixes @samp{.elc} and @samp{.el}.  In
+this case, you must specify the precise file name you want, except
+that, if Auto Compression mode is enabled, @code{load} will still use
address@hidden to find compressed versions.  By
+specifying the precise file name and using @code{t} for
address@hidden, you can prevent perverse file names such as
address@hidden from being tried.
 
 If the optional argument @var{must-suffix} is address@hidden, then
 @code{load} insists that the file name used must end in either
address@hidden or @samp{.elc}, unless it contains an explicit directory
-name.  If @var{filename} does not contain an explicit directory name,
-and does not end in a suffix, then @code{load} insists on adding one.
address@hidden or @samp{.elc} (possibly extended with a compression
+suffix), unless it contains an explicit directory name.
 
 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
@@ -127,8 +138,10 @@
 @deffn Command load-file filename
 This command loads the file @var{filename}.  If @var{filename} is a
 relative file name, then the current default directory is assumed.
address@hidden is not used, and suffixes are not appended.  Use this
-command if you wish to specify precisely the file name to load.
+This command does not use @code{load-path}, and does not append
+suffixes.  However, it does look for compressed versions (if Auto
+Compression Mode is enabled).  Use this command if you wish to specify
+precisely the file name to load.
 @end deffn
 
 @deffn Command load-library library
@@ -158,6 +171,53 @@
   For information about how @code{load} is used in building Emacs, see
 @ref{Building Emacs}.
 
address@hidden Load Suffixes
address@hidden Load Suffixes
+We now describe some technical details about the exact suffixes that
address@hidden tries.
+
address@hidden load-suffixes
+This is a list of suffixes indicating (compiled or source) Emacs Lisp
+files.  It should not include the empty string.  @code{load} uses
+these suffixes in order when it appends Lisp suffixes to the specified
+file name.  The standard value is @code{(".elc" "el")} which produces
+the behavior described in the previous section.
address@hidden defvar
+
address@hidden load-file-rep-suffixes
+This is a list of suffixes that indicate representations of the same
+file.  This list should normally start with the empty string.
+When @code{load} searches for a file it appends the suffixes in this
+list, in order, to the file name, before searching for another file.
+
+Enabling Auto Compression mode appends the suffixes in
address@hidden to this list and disabling Auto
+Compression mode removes them again.  The standard value of
address@hidden if Auto Compression mode is disabled is
address@hidden("")}.  Given that the standard value of
address@hidden is @code{(".gz")}, the standard value
+of @code{load-file-rep-suffixes} if Auto Compression mode is enabled
+is @code{("" ".gz")}.
address@hidden defvar
+
address@hidden get-load-suffixes
+This function returns the list of all suffixes that @code{load} should
+try, in order, when its @var{must-suffix} argument is address@hidden
+This takes both @code{load-suffixes} and @code{load-file-rep-suffixes}
+into account.  If @code{load-suffixes}, @code{jka-compr-load-suffixes}
+and @code{load-file-rep-suffixes} all have their standard values, this
+function returns @code{(".elc" "elc.gz" ".el" ".el.gz")} if Auto
+Compression mode is enabled and @code{(".elc" ".el")} if Auto
+Compression mode is disabled.
address@hidden defun
+
+To summarize, if both its @var{nosuffix} and @var{must-suffix}
+arguments are @code{nil}, @code{load} first tries the suffixes in the
+return value of @code{get-load-suffixes} and then those in
address@hidden  If @var{nosuffix} is address@hidden,
+it only tries the latter and is @var{must-suffix} is address@hidden,
+only the former.
+
 @node Library Search
 @section Library Search
 
@@ -288,13 +348,6 @@
 tells @code{locate-library} to display the file name in the echo area.
 @end deffn
 
address@hidden load-suffixes
-This variable is a list of suffixes (strings) that @code{load} should
-try adding to the specified file name.  The default value is
address@hidden(".elc" ".elc.gz" ".el" ".el.gz" ".gz")}.  There is no need to
-include the null suffix.
address@hidden defvar
-
 @node Loading Non-ASCII
 @section Loading address@hidden Characters
 
@@ -362,7 +415,8 @@
 If @var{filename} does not contain either a directory name, or the
 suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding
 one of these suffixes, and it will not load from a file whose name is
-just @var{filename} with no added suffix.
+just @var{filename} with no added suffix.  (The variable
address@hidden specifies the exact required suffixes.)
 
 The argument @var{docstring} is the documentation string for the
 function.  Specifying the documentation string in the call to
@@ -699,8 +753,10 @@
 with @code{load}.  If @var{filename} is not supplied, then the name of
 the symbol @var{feature} is used as the base file name to load.
 However, in this case, @code{require} insists on finding @var{feature}
-with an added suffix; a file whose name is just @var{feature} won't be
-used.
+with an added @samp{el} or @samp{.elc} suffix (possibly extended with
+a compression suffix); a file whose name is just @var{feature} won't
+be used.  (The variable @code{load-suffixes} specifies the exact
+required Lisp suffixes.)
 
 If @var{noerror} is address@hidden, that suppresses errors from actual
 loading of the file.  In that case, @code{require} returns @code{nil}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]