diff lispref/loading.texi @ 21682:90da2489c498

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Mon, 20 Apr 1998 17:43:57 +0000
parents 66d807bdc5b4
children d4ac295a98b3
line wrap: on
line diff
--- a/lispref/loading.texi	Mon Apr 20 17:37:53 1998 +0000
+++ b/lispref/loading.texi	Mon Apr 20 17:43:57 1998 +0000
@@ -88,6 +88,10 @@
 means you should consider recompiling @file{foo.el}.  @xref{Byte
 Compilation}.
 
+When loading a source file (not compiled), @code{load} performs
+character set translation just as Emacs would do when visiting the file.
+@xref{Coding Systems}.
+
 Messages like @samp{Loading foo...} and @samp{Loading foo...done} appear
 in the echo area during loading unless @var{nomessage} is
 non-@code{nil}.
@@ -170,13 +174,6 @@
 @file{/usr/local/lisplib} directory, and the @file{~/emacs} directory,
 which are then followed by the standard directories for Lisp code.
 
-The command line options @samp{-l} or @samp{-load} specify a Lisp
-library to load as part of Emacs startup.  Since this file might be in
-the current directory, Emacs 18 temporarily adds the current directory
-to the front of @code{load-path} so the file can be found there.  Newer
-Emacs versions also find such files in the current directory, but
-without altering @code{load-path}.
-
 Dumping Emacs uses a special value of @code{load-path}.  If the value of
 @code{load-path} at the end of dumping is unchanged (that is, still the
 same special value), the dumped Emacs switches to the ordinary
@@ -233,7 +230,7 @@
 functions should use @code{read}.
 @end defvar
 
-  To learn how @code{load} is used to build Emacs, see @ref{Building Emacs}.
+  For how @code{load} is used to build Emacs, see @ref{Building Emacs}.
 
 @deffn Command locate-library library &optional nosuffix path interactive-call
 This command finds the precise file name for library @var{library}.  It
@@ -265,11 +262,11 @@
 @code{autoload}, and by writing a special ``magic'' comment in the
 source before the real definition.  @code{autoload} is the low-level
 primitive for autoloading; any Lisp program can call @code{autoload} at
-any time.  Magic comments do nothing on their own; they serve as a guide
-for the command @code{update-file-autoloads}, which constructs calls to
-@code{autoload} and arranges to execute them when Emacs is built.  Magic
-comments are the most convenient way to make a function autoload, but
-only for packages installed along with Emacs.
+any time.  Magic comments are the most convenient way to make a function
+autoload, for packages installed along with Emacs.  They do nothing on
+their own, but they serve as a guide for the command
+@code{update-file-autoloads}, which constructs calls to @code{autoload}
+and arranges to execute them when Emacs is built.
 
 @defun autoload function filename &optional docstring interactive type
 This function defines the function (or macro) named @var{function} so as
@@ -287,10 +284,10 @@
 in the call to @code{autoload} makes it possible to look at the
 documentation without loading the function's real definition.
 
-If @var{interactive} is non-@code{nil}, then the function can be called
-interactively.  This lets completion in @kbd{M-x} work without loading
-the function's real definition.  The complete interactive specification
-is not given here; it's not needed unless the user actually calls
+If @var{interactive} is non-@code{nil}, that says @var{function} can be
+called interactively.  This lets completion in @kbd{M-x} work without
+loading its real definition.  The complete interactive 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.
 
@@ -365,8 +362,9 @@
 comment to execute a form at build time @emph{without} executing it when
 the file itself is loaded.  To do this, write the form @emph{on the same
 line} as the magic comment.  Since it is in a comment, it does nothing
-when you load the source file; but @code{update-file-autoloads} copies
-it to @file{loaddefs.el}, where it is executed while building Emacs.
+when you load the source file; but @kbd{M-x update-file-autoloads}
+copies it to @file{loaddefs.el}, where it is executed while building
+Emacs.
 
   The following example shows how @code{doctor} is prepared for
 autoloading with a magic comment:
@@ -400,7 +398,7 @@
 @section Repeated Loading
 @cindex repeated loading
 
-  You may load one file more than once in an Emacs session.  For
+  You can load one file more than once in an Emacs session.  For
 example, after you have rewritten and reinstalled a function definition
 by editing it in a buffer, you may wish to return to the original
 version; you can do this by reloading the file it came from.
@@ -411,8 +409,8 @@
 that you intend to save and reinstall, you need to byte-compile the new
 version; otherwise Emacs will load the older, byte-compiled file instead
 of your newer, non-compiled file!  If that happens, the message
-displayed when loading the file says, ``(compiled; source is newer'', to
-remind you to recompile.
+displayed when loading the file includes, @samp{(compiled; source is
+newer)}, to remind you to recompile it.
 
   When writing the forms in a Lisp library file, keep in mind that the
 file might be loaded more than once.  For example, think about whether
@@ -445,17 +443,17 @@
 has been loaded before:
 
 @example
-(defvar foo-was-loaded)
+(defvar foo-was-loaded nil)
 
-(if (not (boundp 'foo-was-loaded))
-    @var{execute-first-time-only})
-
-(setq foo-was-loaded t)
+(unless foo-was-loaded
+  @var{execute-first-time-only}
+  (setq foo-was-loaded t))
 @end example
 
 @noindent
 If the library uses @code{provide} to provide a named feature, you can
-use @code{featurep} to test whether the library has been loaded.
+use @code{featurep} earlier in the file to test whether the
+@code{provide} call has been executed before.
 @ifinfo
 @xref{Named Features}.
 @end ifinfo
@@ -486,9 +484,6 @@
 @code{features}; if it fails to do so, @code{require} signals an error.
 @cindex load error with require
 
-  Features are normally named after the files that provide them, so that
-@code{require} need not be given the file name.
-
   For example, in @file{emacs/lisp/prolog.el}, 
 the definition for @code{run-prolog} includes the following code:
 
@@ -504,7 +499,8 @@
 @noindent
 The expression @code{(require 'comint)} loads the file @file{comint.el}
 if it has not yet been loaded.  This ensures that @code{make-comint} is
-defined.
+defined.  Features are normally named after the files that provide them,
+so that @code{require} need not be given the file name.
 
 The @file{comint.el} file contains the following top-level expression:
 
@@ -541,7 +537,7 @@
 The compiler ignores the @code{provide}, then processes the
 @code{require} by loading the file in question.  Loading the file does
 execute the @code{provide} call, so the subsequent @code{require} call
-does nothing while loading.
+does nothing when the file is loaded.
 
 @defun provide feature
 This function announces that @var{feature} is now loaded, or being
@@ -589,7 +585,7 @@
 
 @defun featurep feature
 This function returns @code{t} if @var{feature} has been provided in the
-current Emacs session (i.e., @var{feature} is a member of
+current Emacs session (i.e., if @var{feature} is a member of
 @code{features}.)
 @end defun
 
@@ -612,10 +608,10 @@
 @deffn Command unload-feature feature &optional force
 This command unloads the library that provided feature @var{feature}.
 It undefines all functions, macros, and variables defined in that
-library with @code{defconst}, @code{defvar}, @code{defun},
-@code{defmacro}, @code{defsubst} and @code{defalias}.  It then restores
-any autoloads formerly associated with those symbols.  (Loading
-saves these in the @code{autoload} property of the symbol.)
+library with @code{defun}, @code{defalias}, @code{defsubst},
+@code{defmacro}, @code{defconst}, @code{defvar}, and @code{defcustom}.
+It then restores any autoloads formerly associated with those symbols.
+(Loading saves these in the @code{autoload} property of the symbol.)
 
 Ordinarily, @code{unload-feature} refuses to unload a library on which
 other loaded libraries depend.  (A library @var{a} depends on library
@@ -686,9 +682,9 @@
 the library is loaded.  To do (2), you must load the library (preferably
 with @code{require}).
 
-But it is ok to use @code{eval-after-load} in your personal customizations
-if you don't feel they must meet the design standards of programs to be
-released.
+But it is OK to use @code{eval-after-load} in your personal
+customizations if you don't feel they must meet the design standards for
+programs meant for wider use.
 
 @defvar after-load-alist
 An alist of expressions to evaluate if and when particular libraries are