aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-11-19 04:26:44 +0000
committerRichard M. Stallman1998-11-19 04:26:44 +0000
commit53d5acf5c1cdb4c1e5d3ed6079f0b46bd17560fc (patch)
tree9f185d3cba5c25aea02af17a0ce044113be39298 /src
parent0a3a1c190a81e39b37fd9f23731f1cd9e4d7a84a (diff)
downloademacs-53d5acf5c1cdb4c1e5d3ed6079f0b46bd17560fc.tar.gz
emacs-53d5acf5c1cdb4c1e5d3ed6079f0b46bd17560fc.zip
(Frequire): New arg NOERROR.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/fns.c b/src/fns.c
index c31f8237dff..966e13fe17b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2621,14 +2621,17 @@ DEFUN ("provide", Fprovide, Sprovide, 1, 1, 0,
2621 return feature; 2621 return feature;
2622} 2622}
2623 2623
2624DEFUN ("require", Frequire, Srequire, 1, 2, 0, 2624DEFUN ("require", Frequire, Srequire, 1, 3, 0,
2625 "If feature FEATURE is not loaded, load it from FILENAME.\n\ 2625 "If feature FEATURE is not loaded, load it from FILENAME.\n\
2626If FEATURE is not a member of the list `features', then the feature\n\ 2626If FEATURE is not a member of the list `features', then the feature\n\
2627is not loaded; so load the file FILENAME.\n\ 2627is not loaded; so load the file FILENAME.\n\
2628If FILENAME is omitted, the printname of FEATURE is used as the file name,\n\ 2628If FILENAME is omitted, the printname of FEATURE is used as the file name,\n\
2629but in this case `load' insists on adding the suffix `.el' or `.elc'.") 2629but in this case `load' insists on adding the suffix `.el' or `.elc'.\n\
2630 (feature, file_name) 2630If the optional third argument NOERROR is non-nil,\n\
2631 Lisp_Object feature, file_name; 2631then return nil if the file is not found.\n\
2632Normally the return value is FEATURE.")
2633 (feature, file_name, noerror)
2634 Lisp_Object feature, file_name, noerror;
2632{ 2635{
2633 register Lisp_Object tem; 2636 register Lisp_Object tem;
2634 CHECK_SYMBOL (feature, 0); 2637 CHECK_SYMBOL (feature, 0);
@@ -2642,8 +2645,11 @@ but in this case `load' insists on adding the suffix `.el' or `.elc'.")
2642 record_unwind_protect (un_autoload, Vautoload_queue); 2645 record_unwind_protect (un_autoload, Vautoload_queue);
2643 Vautoload_queue = Qt; 2646 Vautoload_queue = Qt;
2644 2647
2645 Fload (NILP (file_name) ? Fsymbol_name (feature) : file_name, 2648 tem = Fload (NILP (file_name) ? Fsymbol_name (feature) : file_name,
2646 Qnil, Qt, Qnil, (NILP (file_name) ? Qt : Qnil)); 2649 noerror, Qt, Qnil, (NILP (file_name) ? Qt : Qnil));
2650 /* If load failed entirely, return nil. */
2651 if (NILP (tem))
2652 return Qnil;
2647 2653
2648 tem = Fmemq (feature, Vfeatures); 2654 tem = Fmemq (feature, Vfeatures);
2649 if (NILP (tem)) 2655 if (NILP (tem))