# HG changeset patch # User youngs # Date 1035467749 0 # Node ID a0a7ace216fe837e2087742d7de542213cceaa69 # Parent 5de13d96e131ba4e951222cc21d3484e02c5e888 [xemacs-hg @ 2002-10-24 13:55:42 by youngs] 2002-10-24 John Paul Wallington * fns.c (Frequire): Add optional `noerror' argument. diff -r 5de13d96e131 -r a0a7ace216fe src/ChangeLog --- a/src/ChangeLog Thu Oct 24 13:49:13 2002 +0000 +++ b/src/ChangeLog Thu Oct 24 13:55:49 2002 +0000 @@ -1,3 +1,7 @@ +2002-10-24 John Paul Wallington + + * fns.c (Frequire): Add optional `noerror' argument. + 2002-10-24 Andy Piper * glyphs-widget.c (layout_query_geometry): only resize dynamically diff -r 5de13d96e131 -r a0a7ace216fe src/fns.c --- 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))