comparison src/fns.c @ 3842:1c2a46ea1f78

[xemacs-hg @ 2007-02-22 16:53:20 by stephent] Doc fixes 2007-02-21. <87k5yaku0s.fsf@uwakimon.sk.tsukuba.ac.jp>
author stephent
date Thu, 22 Feb 2007 16:53:27 +0000
parents 73288faa5759
children 80cd90837ac5
comparison
equal deleted inserted replaced
3841:5989b9bbb612 3842:1c2a46ea1f78
3574 LOADHIST_ATTACH (Fcons (Qprovide, feature)); 3574 LOADHIST_ATTACH (Fcons (Qprovide, feature));
3575 return feature; 3575 return feature;
3576 } 3576 }
3577 3577
3578 DEFUN ("require", Frequire, 1, 3, 0, /* 3578 DEFUN ("require", Frequire, 1, 3, 0, /*
3579 If feature FEATURE is not loaded, load it from FILENAME. 3579 Ensure that FEATURE is present in the Lisp environment.
3580 If FEATURE is not a member of the list `features', then the feature 3580 FEATURE is a symbol naming a collection of resources (functions, etc).
3581 is not loaded; so load the file FILENAME. 3581 Optional FILENAME is a library from which to load resources; it defaults to
3582 If FILENAME is omitted, the printname of FEATURE is used as the file name. 3582 the print name of FEATURE.
3583 If optional third argument NOERROR is non-nil, then return nil if the file 3583 Optional NOERROR, if non-nil, causes require to return nil rather than signal
3584 is not found instead of signaling an error. 3584 `file-error' if loading the library fails.
3585 Normally the return value is FEATURE. 3585
3586 The normal messages at start and end of loading FILENAME are suppressed. 3586 If feature FEATURE is present in `features', update `load-history' to reflect
3587 3587 the require and return FEATURE. Otherwise, try to load it from a library.
3588 In order to make it possible for a required package to provide macros to be 3588 The normal messages at start and end of loading are suppressed.
3589 expanded at byte-compilation time, top level calls of `require' are 3589 If the library is successfully loaded and it calls `(provide FEATURE)', add
3590 evaluated both at byte-compile time and at run time. That is, any top-level 3590 FEATURE to `features', update `load-history' and return FEATURE.
3591 call to `require' is wrapped in an implicit \(eval-and-compile ...\) block. 3591 If the load succeeds but FEATURE is not provided by the library, signal
3592 `invalid-state'.
3593
3594 The byte-compiler treats top-level calls to `require' specially, by evaluating
3595 them at compile time (and then compiling them normally). Thus a library may
3596 request that definitions that should be inlined such as macros and defsubsts
3597 be loaded into its compilation environment. Achieving this in other contexts
3598 requires an explicit \(eval-and-compile ...\) block.
3592 */ 3599 */
3593 (feature, filename, noerror)) 3600 (feature, filename, noerror))
3594 { 3601 {
3595 Lisp_Object tem; 3602 Lisp_Object tem;
3596 CHECK_SYMBOL (feature); 3603 CHECK_SYMBOL (feature);