Mercurial > hg > xemacs-beta
diff 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 |
line wrap: on
line diff
--- a/src/fns.c Thu Feb 22 16:19:44 2007 +0000 +++ b/src/fns.c Thu Feb 22 16:53:27 2007 +0000 @@ -3576,19 +3576,26 @@ } DEFUN ("require", Frequire, 1, 3, 0, /* -If feature FEATURE is not loaded, load it from FILENAME. -If FEATURE is not a member of the list `features', then the feature -is not loaded; so load the file FILENAME. -If FILENAME is omitted, the printname of FEATURE is used as the file name. -If optional third argument NOERROR is non-nil, then return nil if the file -is not found instead of signaling an error. -Normally the return value is FEATURE. -The normal messages at start and end of loading FILENAME are suppressed. - -In order to make it possible for a required package to provide macros to be -expanded at byte-compilation time, top level calls of `require' are -evaluated both at byte-compile time and at run time. That is, any top-level -call to `require' is wrapped in an implicit \(eval-and-compile ...\) block. +Ensure that FEATURE is present in the Lisp environment. +FEATURE is a symbol naming a collection of resources (functions, etc). +Optional FILENAME is a library from which to load resources; it defaults to +the print name of FEATURE. +Optional NOERROR, if non-nil, causes require to return nil rather than signal +`file-error' if loading the library fails. + +If feature FEATURE is present in `features', update `load-history' to reflect +the require and return FEATURE. Otherwise, try to load it from a library. +The normal messages at start and end of loading are suppressed. +If the library is successfully loaded and it calls `(provide FEATURE)', add +FEATURE to `features', update `load-history' and return FEATURE. +If the load succeeds but FEATURE is not provided by the library, signal +`invalid-state'. + +The byte-compiler treats top-level calls to `require' specially, by evaluating +them at compile time (and then compiling them normally). Thus a library may +request that definitions that should be inlined such as macros and defsubsts +be loaded into its compilation environment. Achieving this in other contexts +requires an explicit \(eval-and-compile ...\) block. */ (feature, filename, noerror)) {