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 | |
| 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')
| -rw-r--r-- | src/alloc.c | 2 | ||||
| -rw-r--r-- | src/fns.c | 5 | ||||
| -rw-r--r-- | src/lread.c | 22 |
3 files changed, 16 insertions, 13 deletions
diff --git a/src/alloc.c b/src/alloc.c index 53f974533a8..ad3f5235480 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3712,7 +3712,7 @@ make_event_array (ptrdiff_t nargs, Lisp_Object *args) | |||
| 3712 | } | 3712 | } |
| 3713 | 3713 | ||
| 3714 | #ifdef HAVE_MODULES | 3714 | #ifdef HAVE_MODULES |
| 3715 | /* Create a new module user ptr object. */ | 3715 | /* Create a new module user ptr object. */ |
| 3716 | Lisp_Object | 3716 | Lisp_Object |
| 3717 | make_user_ptr (void (*finalizer) (void*), void *p) | 3717 | make_user_ptr (void (*finalizer) (void*), void *p) |
| 3718 | { | 3718 | { |
| @@ -2764,8 +2764,9 @@ DEFUN ("require", Frequire, Srequire, 1, 3, 0, | |||
| 2764 | If FEATURE is not a member of the list `features', then the feature | 2764 | If FEATURE is not a member of the list `features', then the feature |
| 2765 | is not loaded; so load the file FILENAME. | 2765 | is not loaded; so load the file FILENAME. |
| 2766 | If FILENAME is omitted, the printname of FEATURE is used as the file name, | 2766 | If FILENAME is omitted, the printname of FEATURE is used as the file name, |
| 2767 | and `load' will try to load this name appended with the suffix `.elc' or | 2767 | and `load' will try to load this name appended with the suffix `.elc', |
| 2768 | `.el', in that order. The name without appended suffix will not be used. | 2768 | `.el', or the system-dependent suffix for dynamic module files, in that |
| 2769 | order. The name without appended suffix will not be used. | ||
| 2769 | See `get-load-suffixes' for the complete list of suffixes. | 2770 | See `get-load-suffixes' for the complete list of suffixes. |
| 2770 | If the optional third argument NOERROR is non-nil, | 2771 | If the optional third argument NOERROR is non-nil, |
| 2771 | then return nil if the file is not found instead of signaling an error. | 2772 | then return nil if the file is not found instead of signaling an error. |
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"), |