aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/loading.texi
diff options
context:
space:
mode:
Diffstat (limited to 'lispref/loading.texi')
-rw-r--r--lispref/loading.texi34
1 files changed, 19 insertions, 15 deletions
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 61c5b13ca6f..e12826af2f8 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -1,7 +1,7 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
4@c 2003, 2004 4@c 2003, 2004, 2005
5@c Free Software Foundation, Inc. 5@c Free Software Foundation, Inc.
6@c See the file elisp.texi for copying conditions. 6@c See the file elisp.texi for copying conditions.
7@setfilename ../info/loading 7@setfilename ../info/loading
@@ -365,10 +365,12 @@ one of these suffixes, and it will not load from a file whose name is
365just @var{filename} with no added suffix. 365just @var{filename} with no added suffix.
366 366
367The argument @var{docstring} is the documentation string for the 367The argument @var{docstring} is the documentation string for the
368function. Normally, this should be identical to the documentation string 368function. Specifying the documentation string in the call to
369in the function definition itself. Specifying the documentation string 369@code{autoload} makes it possible to look at the documentation without
370in the call to @code{autoload} makes it possible to look at the 370loading the function's real definition. Normally, this should be
371documentation without loading the function's real definition. 371identical to the documentation string in the function definition
372itself. If it isn't, the function definition's documentation string
373takes effect when it is loaded.
372 374
373If @var{interactive} is non-@code{nil}, that says @var{function} can be 375If @var{interactive} is non-@code{nil}, that says @var{function} can be
374called interactively. This lets completion in @kbd{M-x} work without 376called interactively. This lets completion in @kbd{M-x} work without
@@ -526,8 +528,7 @@ initialized. (@xref{Defining Variables}.)
526 The simplest way to add an element to an alist is like this: 528 The simplest way to add an element to an alist is like this:
527 529
528@example 530@example
529(setq minor-mode-alist 531(push '(leif-mode " Leif") minor-mode-alist)
530 (cons '(leif-mode " Leif") minor-mode-alist))
531@end example 532@end example
532 533
533@noindent 534@noindent
@@ -536,12 +537,15 @@ To avoid the problem, write this:
536 537
537@example 538@example
538(or (assq 'leif-mode minor-mode-alist) 539(or (assq 'leif-mode minor-mode-alist)
539 (setq minor-mode-alist 540 (push '(leif-mode " Leif") minor-mode-alist))
540 (cons '(leif-mode " Leif") minor-mode-alist)))
541@end example 541@end example
542 542
543 To add an element to a list just once, you can also use @code{add-to-list} 543@noindent
544(@pxref{Setting Variables}). 544or this:
545
546@example
547(add-to-list '(leif-mode " Leif") minor-mode-alist)
548@end example
545 549
546 Occasionally you will want to test explicitly whether a library has 550 Occasionally you will want to test explicitly whether a library has
547already been loaded. Here's one way to test, in a library, whether it 551already been loaded. Here's one way to test, in a library, whether it
@@ -746,12 +750,12 @@ elements have these forms:
746@item @var{var} 750@item @var{var}
747The symbol @var{var} was defined as a variable. 751The symbol @var{var} was defined as a variable.
748@item (defun . @var{fun}) 752@item (defun . @var{fun})
749The @var{fun} was defined by this library. 753The function @var{fun} was defined.
750@item (t . @var{fun}) 754@item (t . @var{fun})
751The function @var{fun} was previously an autoload before this library 755The function @var{fun} was previously an autoload before this library
752redefined it as a function. The following element is always the 756redefined it as a function. The following element is always
753symbol @var{fun}, which signifies that the library defined @var{fun} 757@code{(defun . @var{fun})}, which represents defining @var{fun} as a
754as a function. 758function.
755@item (autoload . @var{fun}) 759@item (autoload . @var{fun})
756The function @var{fun} was defined as an autoload. 760The function @var{fun} was defined as an autoload.
757@item (require . @var{feature}) 761@item (require . @var{feature})