diff options
| author | Richard M. Stallman | 2005-02-14 10:16:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-02-14 10:16:24 +0000 |
| commit | 9e328e231a6f97b580de43102bf1730e4c4b9cbf (patch) | |
| tree | 22a2309952343289fd69fc8ccddd3460999e81a4 | |
| parent | 23e69ab14b523136d671c22da8ca8ba16bef89e9 (diff) | |
| download | emacs-9e328e231a6f97b580de43102bf1730e4c4b9cbf.tar.gz emacs-9e328e231a6f97b580de43102bf1730e4c4b9cbf.zip | |
(Autoload): defun's doc string overrides autoload's doc string.
(Repeated Loading): Modernize "add to list" examples.
(Where Defined): Finish updating table of load-history elts.
| -rw-r--r-- | lispref/loading.texi | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/lispref/loading.texi b/lispref/loading.texi index 61c5b13ca6f..ecd08868495 100644 --- a/lispref/loading.texi +++ b/lispref/loading.texi | |||
| @@ -365,10 +365,12 @@ one of these suffixes, and it will not load from a file whose name is | |||
| 365 | just @var{filename} with no added suffix. | 365 | just @var{filename} with no added suffix. |
| 366 | 366 | ||
| 367 | The argument @var{docstring} is the documentation string for the | 367 | The argument @var{docstring} is the documentation string for the |
| 368 | function. Normally, this should be identical to the documentation string | 368 | function. Specifying the documentation string in the call to |
| 369 | in the function definition itself. Specifying the documentation string | 369 | @code{autoload} makes it possible to look at the documentation without |
| 370 | in the call to @code{autoload} makes it possible to look at the | 370 | loading the function's real definition. Normally, this should be |
| 371 | documentation without loading the function's real definition. | 371 | identical to the documentation string in the function definition |
| 372 | itself. If it isn't, the function definition's documentation string | ||
| 373 | takes effect when it is loaded. | ||
| 372 | 374 | ||
| 373 | If @var{interactive} is non-@code{nil}, that says @var{function} can be | 375 | If @var{interactive} is non-@code{nil}, that says @var{function} can be |
| 374 | called interactively. This lets completion in @kbd{M-x} work without | 376 | called 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}). | 544 | or 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 |
| 547 | already been loaded. Here's one way to test, in a library, whether it | 551 | already 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} |
| 747 | The symbol @var{var} was defined as a variable. | 751 | The symbol @var{var} was defined as a variable. |
| 748 | @item (defun . @var{fun}) | 752 | @item (defun . @var{fun}) |
| 749 | The @var{fun} was defined by this library. | 753 | The function @var{fun} was defined. |
| 750 | @item (t . @var{fun}) | 754 | @item (t . @var{fun}) |
| 751 | The function @var{fun} was previously an autoload before this library | 755 | The function @var{fun} was previously an autoload before this library |
| 752 | redefined it as a function. The following element is always the | 756 | redefined it as a function. The following element is always |
| 753 | symbol @var{fun}, which signifies that the library defined @var{fun} | 757 | @code{(defun . @var{fun}), which represents defining @var{fun} as a |
| 754 | as a function. | 758 | function. |
| 755 | @item (autoload . @var{fun}) | 759 | @item (autoload . @var{fun}) |
| 756 | The function @var{fun} was defined as an autoload. | 760 | The function @var{fun} was defined as an autoload. |
| 757 | @item (require . @var{feature}) | 761 | @item (require . @var{feature}) |