diff options
| author | Eli Zaretskii | 2015-11-21 12:49:57 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-21 12:49:57 +0200 |
| commit | 3858b7949fdf5af8dd94cefc5a2684ad285e2cdf (patch) | |
| tree | f7e4566d0b46d076166bb13d6c6200e089819174 /src/lread.c | |
| parent | 2299267805bbf5ece023908922383677b5d4a44b (diff) | |
| download | emacs-3858b7949fdf5af8dd94cefc5a2684ad285e2cdf.tar.gz emacs-3858b7949fdf5af8dd94cefc5a2684ad285e2cdf.zip | |
Improve documentation of dynamic modules
* src/fns.c (Frequire): Doc fix to include the dynamic module
support.
* src/lread.c (Fload, Vload_suffixes): Doc fixes to include the
dynamic module support.
(Fload): Treat the module suffix the same as '*.el' and '*.elc'
wrt the MUST-SUFFIX argument.
* etc/NEWS: Expand documentation of dynamically loaded modules.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lread.c b/src/lread.c index 43100d9f699..bbff21d01d7 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -987,7 +987,8 @@ suffix_p (Lisp_Object string, const char *suffix) | |||
| 987 | 987 | ||
| 988 | DEFUN ("load", Fload, Sload, 1, 5, 0, | 988 | DEFUN ("load", Fload, Sload, 1, 5, 0, |
| 989 | doc: /* Execute a file of Lisp code named FILE. | 989 | doc: /* Execute a file of Lisp code named FILE. |
| 990 | First try FILE with `.elc' appended, then try with `.el', | 990 | First try FILE with `.elc' appended, then try with `.el', then try |
| 991 | with a system-dependent suffix of dynamic modules (see `load-suffixes'), | ||
| 991 | then try FILE unmodified (the exact suffixes in the exact order are | 992 | then try FILE unmodified (the exact suffixes in the exact order are |
| 992 | determined by `load-suffixes'). Environment variable references in | 993 | determined by `load-suffixes'). Environment variable references in |
| 993 | FILE are replaced with their values by calling `substitute-in-file-name'. | 994 | FILE are replaced with their values by calling `substitute-in-file-name'. |
| @@ -999,10 +1000,10 @@ Print messages at start and end of loading unless | |||
| 999 | optional third arg NOMESSAGE is non-nil (but `force-load-messages' | 1000 | optional third arg NOMESSAGE is non-nil (but `force-load-messages' |
| 1000 | overrides that). | 1001 | overrides that). |
| 1001 | If optional fourth arg NOSUFFIX is non-nil, don't try adding | 1002 | If optional fourth arg NOSUFFIX is non-nil, don't try adding |
| 1002 | suffixes `.elc' or `.el' to the specified name FILE. | 1003 | suffixes to the specified name FILE. |
| 1003 | If optional fifth arg MUST-SUFFIX is non-nil, insist on | 1004 | If optional fifth arg MUST-SUFFIX is non-nil, insist on |
| 1004 | the suffix `.elc' or `.el'; don't accept just FILE unless | 1005 | the suffix `.elc' or `.el' or the module suffix; don't accept just |
| 1005 | it ends in one of those suffixes or includes a directory name. | 1006 | FILE unless it ends in one of those suffixes or includes a directory name. |
| 1006 | 1007 | ||
| 1007 | If NOSUFFIX is nil, then if a file could not be found, try looking for | 1008 | If NOSUFFIX is nil, then if a file could not be found, try looking for |
| 1008 | a different representation of the file by adding non-empty suffixes to | 1009 | a different representation of the file by adding non-empty suffixes to |
| @@ -1084,7 +1085,9 @@ Return t if the file exists and loads successfully. */) | |||
| 1084 | if (! NILP (must_suffix)) | 1085 | if (! NILP (must_suffix)) |
| 1085 | { | 1086 | { |
| 1086 | /* Don't insist on adding a suffix if FILE already ends with one. */ | 1087 | /* Don't insist on adding a suffix if FILE already ends with one. */ |
| 1087 | if (suffix_p (file, ".el") || suffix_p (file, ".elc")) | 1088 | if (suffix_p (file, ".el") |
| 1089 | || suffix_p (file, ".elc") | ||
| 1090 | || suffix_p (file, MODULES_SUFFIX)) | ||
| 1088 | must_suffix = Qnil; | 1091 | must_suffix = Qnil; |
| 1089 | /* Don't insist on adding a suffix | 1092 | /* Don't insist on adding a suffix |
| 1090 | if the argument includes a directory name. */ | 1093 | if the argument includes a directory name. */ |
| @@ -1158,9 +1161,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1158 | 1161 | ||
| 1159 | #ifdef HAVE_MODULES | 1162 | #ifdef HAVE_MODULES |
| 1160 | if (suffix_p (found, MODULES_SUFFIX)) | 1163 | if (suffix_p (found, MODULES_SUFFIX)) |
| 1161 | { | 1164 | return Fmodule_load (found); |
| 1162 | return Fmodule_load (found); | ||
| 1163 | } | ||
| 1164 | #endif | 1165 | #endif |
| 1165 | 1166 | ||
| 1166 | /* Check if we're stuck in a recursive load cycle. | 1167 | /* Check if we're stuck in a recursive load cycle. |
| @@ -4498,10 +4499,11 @@ programs that process this list should tolerate directories both with | |||
| 4498 | and without trailing slashes. */); | 4499 | and without trailing slashes. */); |
| 4499 | 4500 | ||
| 4500 | DEFVAR_LISP ("load-suffixes", Vload_suffixes, | 4501 | DEFVAR_LISP ("load-suffixes", Vload_suffixes, |
| 4501 | doc: /* List of suffixes for (compiled or source) Emacs Lisp files. | 4502 | doc: /* List of suffixes for Emacs Lisp files and dynamic modules. |
| 4503 | This list includes suffixes for both compiled and source Emacs Lisp files. | ||
| 4502 | This list should not include the empty string. | 4504 | This list should not include the empty string. |
| 4503 | `load' and related functions try to append these suffixes, in order, | 4505 | `load' and related functions try to append these suffixes, in order, |
| 4504 | to the specified file name if a Lisp suffix is allowed or required. */); | 4506 | to the specified file name if a suffix is allowed or required. */); |
| 4505 | #ifdef HAVE_MODULES | 4507 | #ifdef HAVE_MODULES |
| 4506 | Vload_suffixes = list3 (build_pure_c_string (".elc"), | 4508 | Vload_suffixes = list3 (build_pure_c_string (".elc"), |
| 4507 | build_pure_c_string (".el"), | 4509 | build_pure_c_string (".el"), |