diff options
| author | Richard M. Stallman | 1998-11-19 04:26:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-11-19 04:26:44 +0000 |
| commit | 53d5acf5c1cdb4c1e5d3ed6079f0b46bd17560fc (patch) | |
| tree | 9f185d3cba5c25aea02af17a0ce044113be39298 /src | |
| parent | 0a3a1c190a81e39b37fd9f23731f1cd9e4d7a84a (diff) | |
| download | emacs-53d5acf5c1cdb4c1e5d3ed6079f0b46bd17560fc.tar.gz emacs-53d5acf5c1cdb4c1e5d3ed6079f0b46bd17560fc.zip | |
(Frequire): New arg NOERROR.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 18 |
1 files changed, 12 insertions, 6 deletions
| @@ -2621,14 +2621,17 @@ DEFUN ("provide", Fprovide, Sprovide, 1, 1, 0, | |||
| 2621 | return feature; | 2621 | return feature; |
| 2622 | } | 2622 | } |
| 2623 | 2623 | ||
| 2624 | DEFUN ("require", Frequire, Srequire, 1, 2, 0, | 2624 | DEFUN ("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\ |
| 2626 | If FEATURE is not a member of the list `features', then the feature\n\ | 2626 | If FEATURE is not a member of the list `features', then the feature\n\ |
| 2627 | is not loaded; so load the file FILENAME.\n\ | 2627 | is not loaded; so load the file FILENAME.\n\ |
| 2628 | If FILENAME is omitted, the printname of FEATURE is used as the file name,\n\ | 2628 | If FILENAME is omitted, the printname of FEATURE is used as the file name,\n\ |
| 2629 | but in this case `load' insists on adding the suffix `.el' or `.elc'.") | 2629 | but in this case `load' insists on adding the suffix `.el' or `.elc'.\n\ |
| 2630 | (feature, file_name) | 2630 | If the optional third argument NOERROR is non-nil,\n\ |
| 2631 | Lisp_Object feature, file_name; | 2631 | then return nil if the file is not found.\n\ |
| 2632 | Normally 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)) |