GNU Info

Info Node: (librep.info)Load Function

(librep.info)Load Function


Next: Autoloading Up: Loading
Enter node , (file) or (file)node

Load Function
-------------

 - Function: load program #!optional no-error no-path no-suffix
     This function loads the file containing the program called PROGRAM;
     first the file is located then each top-level form contained by
     the file is read and evaluated in order.

     Each directory named by the variable `load-path' is searched until
     the file containing PROGRAM is found. In each directory three
     different file names are tried,

       1. PROGRAM with `.jlc' appended to it. Files with a `.jlc'
          suffix are usually compiled Lisp files. Note: Compiled Lisp.

       2. PROGRAM with `.jl' appended, most uncompiled Lisp programs are
          stored in files with names like this.

       3. PROGRAM with no modifications.

     If none of these gives a result the next directory is searched in
     the same way, when all directories in `load-path' have been
     exhausted and the file still has not been found an error is
     signalled.

     Next the file is opened for reading and Lisp forms are read from it
     one at a time, each form is evaluated before the next form is
     read. When the end of the file is reached the file has been loaded
     and this function returns true.

     The optional arguments to this function are used to modify its
     behaviour,

    NO-ERROR
          When this argument is true no error is signalled if the file
          can not be located. Instead the function returns false.

    NO-PATH
          The variable `load-path' is not used, PROGRAM must point to
          the file from the current working directory.

    NO-SUFFIX
          When true no `.jlc' or `.jl' suffixes are applied to the
          PROGRAM argument when locating the file.

     If a version of the program whose name ends in `.jlc' is older than
     a `.jl' version of the same file (i.e. the source code is newer
     than the compiled version) a warning is displayed and the `.jl'
     version is used.

     If no Lisp file can be found matching PROGRAM, then each directory
     in the variable `dl-load-path' is searched for a `libtool' shared
     library called `PROGRAM.la' (Note: Shared Libraries).

 - Variable: load-filename
     Whilst loading a Lisp library, this variable is bound to the name
     of the file being loaded.

 - Variable: load-path
     A list of strings, each element is the name of a directory which is
     prefixed to the name of a program when Lisp program files are being
     searched for.

          load-path
              => ("/usr/local/lib/rep/1.0/lisp/"
                  "/usr/local/lib/rep/site-lisp/" "")

     The element `""' refers to the current directory, note that
     directory names should have an ending `/' (or whatever) so that
     when concatenated with the name of the file they make a meaningful
     filename.

 - Variable: dl-load-path
     A list of strings defining all directories to search for shared
     libraries.

 - Variable: lisp-lib-directory
     The name of the directory in which the standard Lisp files are
     stored.

          lisp-lib-dir
              => "/usr/local/lib/rep/1.0/lisp/"

 - Variable: after-load-alist
     An association list of elements of the format `(FILE FORMS ...)'.
     When the library FILE is loaded, all FORMS are executed. However,
     note that FILE must _exactly_ match the PROGRAM argument to the
     `load' function.

 - Function: eval-after-load library form
     Arrange for FORM to be evaluated immediately after the Lisp
     library of LIBRARY has been read by the `load' function.  Note
     that LIBRARY must exactly match the PROGRAM argument to `load'.


automatically generated by info2www version 1.2.2.9