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
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.
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.
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}.
For example,
@example
+@group
(symbol-function 'run-prolog)
@result{} (autoload "prolog" 169681 t nil)
+@end group
@end example
@noindent
@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.
@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))
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}).