]> code.delx.au - gnu-emacs/blobdiff - lispref/loading.texi
(Fx_create_frame): Default vertical-scroll-bars as symbol, not boolean.
[gnu-emacs] / lispref / loading.texi
index 3f88132b20b00181ee7c65f6364eb06d24a74c62..29c2480f1f5ef17ebb606f53f611b3fde9aaa48d 100644 (file)
@@ -157,18 +157,20 @@ Here is an example of code you can place in a @file{.emacs} file to add
 several directories to the front of your default @code{load-path}:
 
 @smallexample
+@group
 (setq load-path
       (append (list nil "/user/bil/emacs"
                     "/usr/local/lisplib"
-                    (expand-file-name "~/emacs"))
+                    "~/emacs")
               load-path))
+@end group
 @end smallexample
 
 @c Wordy to rid us of an overfull hbox.  --rjc 15mar92
 @noindent
 In this example, the path searches the current working directory first,
-followed then by the @file{/user/bil/emacs} directory and then by
-the @file{/usr/local/lisplib} directory,
+followed then by the @file{/user/bil/emacs} directory, the
+@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
@@ -181,7 +183,7 @@ 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
-@code{load-path} value when it starts up, as decribed above.  But if
+@code{load-path} value when it starts up, as described above.  But if
 @code{load-path} has any other value at the end of dumping, that value
 is used for execution of the dumped Emacs also.
 
@@ -191,6 +193,35 @@ you should bind @code{load-path} locally with @code{let} around the
 calls to @code{load}.
 @end defopt
 
+  The default value of @code{load-path}, when running an Emacs which has
+been installed on the system, looks like this:
+
+@smallexample
+("/usr/local/share/emacs/@var{version}/site-lisp"
+ "/usr/local/share/emacs/site-lisp"
+ "/usr/local/share/emacs/@var{version}/lisp")
+@end smallexample
+
+  The last of these three directories is where the Lisp files of Emacs
+itself are installed; the first two are for additional Lisp packages
+installed at your site.  The first directory is for locally installed
+packages that belong with a particular Emacs version; the second is for
+locally installed packages that can be used with any installed Emacs
+version.
+
+  There are several reasons why a Lisp package that works well in one
+Emacs version can cause trouble in another.  Sometimes packages need
+updating for incompatible changes in Emacs; sometimes they depend on
+undocumented internal Emacs data that can change without notice;
+sometimes a newer Emacs version incorporates a version of the package,
+and should be used only with that version.
+
+  If you run Emacs from the directory where it was built---that is, an
+executable that has not been formally installed---then @code{load-path}
+normally contains two additional directories.  These are the @code{lisp}
+and @code{site-lisp} subdirectories of the main build directory.  (Both
+are represented as absolute file names.)
+
 @defvar load-in-progress
 This variable is non-@code{nil} if Emacs is in the process of loading a
 file, and it is @code{nil} otherwise.
@@ -251,6 +282,13 @@ Specify @var{type} as @code{keymap} if @var{function} is really a
 keymap.  Various parts of Emacs need to know this information without
 loading the real definition.
 
+An autoloaded keymap loads automatically during key lookup when a prefix
+key's binding is the symbol @var{function}.  Autoloading does not occur
+for other kinds of access to the keymap.  In particular, it does not
+happen when a Lisp program gets the keymap from the value of a variable
+and calls @code{define-key}; not even if the variable name is the same
+symbol @var{function}.
+
 @cindex function cell in autoload
 If @var{function} already has a non-void function definition that is not
 an autoload object, @code{autoload} does nothing and returns @code{nil}.
@@ -264,8 +302,10 @@ object, then it is defined as an autoload object like this:
 For example, 
 
 @example
+@group
 (symbol-function 'run-prolog)
      @result{} (autoload "prolog" 169681 t nil)
+@end group
 @end example
 
 @noindent
@@ -304,7 +344,7 @@ autoloads for all files in the current directory.
 @file{loaddefs.el}.  If the form following the magic comment is not a
 function definition, it is copied verbatim.  You can also use a magic
 comment to execute a form at build time @emph{without} executing it when
-the file itself is loaded.  To do this, write the form @dfn{on the same
+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.
@@ -434,7 +474,7 @@ the definition for @code{run-prolog} includes the following code:
 
 @smallexample
 (defun run-prolog ()
-  "Run an inferior Prolog process, input and output via buffer *prolog*."
+  "Run an inferior Prolog process, with I/O via buffer *prolog*."
   (interactive)
   (require 'comint)
   (switch-to-buffer (make-comint "prolog" prolog-program-name))
@@ -616,7 +656,7 @@ execution of the rest of @var{form}.
 In general, well-designed Lisp programs should not use this feature.
 The clean and modular ways to interact with a Lisp library are (1)
 examine and set the library's variables (those which are meant for
-outside use), and and (2) call the library's functions.  If you wish to
+outside use), and (2) call the library's functions.  If you wish to
 do (1), you can do it immediately---there is no need to wait for when
 the library is loaded.  To do (2), you must load the library (preferably
 with @code{require}).