Mercurial > hg > xemacs-beta
diff src/fns.c @ 1067:a0a7ace216fe
[xemacs-hg @ 2002-10-24 13:55:42 by youngs]
2002-10-24 John Paul Wallington <jpw@shootybangbang.com>
* fns.c (Frequire): Add optional `noerror' argument.
author | youngs |
---|---|
date | Thu, 24 Oct 2002 13:55:49 +0000 |
parents | 7a35465d73bc |
children | e22b0213b713 |
line wrap: on
line diff
--- a/src/fns.c Thu Oct 24 13:49:13 2002 +0000 +++ b/src/fns.c Thu Oct 24 13:55:49 2002 +0000 @@ -3546,13 +3546,15 @@ return feature; } -DEFUN ("require", Frequire, 1, 2, 0, /* +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. */ - (feature, filename)) + (feature, filename, noerror)) { Lisp_Object tem; CHECK_SYMBOL (feature); @@ -3568,8 +3570,11 @@ record_unwind_protect (un_autoload, Vautoload_queue); Vautoload_queue = Qt; - call4 (Qload, NILP (filename) ? Fsymbol_name (feature) : filename, - Qnil, require_prints_loading_message ? Qrequire : Qt, Qnil); + tem = call4 (Qload, NILP (filename) ? Fsymbol_name (feature) : filename, + noerror, require_prints_loading_message ? Qrequire : Qt, Qnil); + /* If load failed entirely, return nil. */ + if (NILP (tem)) + return unbind_to_1 (speccount, Qnil); tem = Fmemq (feature, Vfeatures); if (NILP (tem))