comparison lispref/loading.texi @ 83255:9684495d72bc

Merged from miles@gnu.org--gnu-2005 (patch 14-16, 95-106) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-95 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-96 Move Gnus images into etc/images * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-97 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-98 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-99 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-100 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-101 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-102 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-103 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-104 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-105 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-106 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-14 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-15 Update from CVS: lisp/imap.el (imap-log): Doc fix. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-16 Merge from emacs--cvs-trunk--0 git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-295
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 19 Feb 2005 00:06:48 +0000
parents cfd3265fdbc5
children 32b9b0540e8a 7e3f621f1dd4
comparison
equal deleted inserted replaced
83254:e9810bf10871 83255:9684495d72bc
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
8 @node Loading, Byte Compilation, Customization, Top 8 @node Loading, Byte Compilation, Customization, Top
9 @chapter Loading 9 @chapter Loading
363 suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding 363 suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding
364 one of these suffixes, and it will not load from a file whose name is 364 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
375 loading @var{function}'s real definition. The complete interactive 377 loading @var{function}'s real definition. The complete interactive
376 specification is not given here; it's not needed unless the user 378 specification is not given here; it's not needed unless the user
524 initialized. (@xref{Defining Variables}.) 526 initialized. (@xref{Defining Variables}.)
525 527
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
534 But this would add multiple elements if the library is reloaded. 535 But this would add multiple elements if the library is reloaded.
535 To avoid the problem, write this: 536 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
548 has been loaded before: 552 has been loaded before:
549 553
744 748
745 @table @code 749 @table @code
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})
758 The feature @var{feature} was required. 762 The feature @var{feature} was required.
759 @item (provide . @var{feature}) 763 @item (provide . @var{feature})