diff options
| author | Eli Zaretskii | 2015-11-22 20:38:51 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-22 20:38:51 +0200 |
| commit | 40ed767ba0a35dbaeee6bdbd85a108d88a982b1a (patch) | |
| tree | b726762b86a3a5b3fdfaf7216e995a21cb2e1e62 /src | |
| parent | 9f0d19f24cd455765123a378a5e2f3e505cbb5ac (diff) | |
| download | emacs-40ed767ba0a35dbaeee6bdbd85a108d88a982b1a.tar.gz emacs-40ed767ba0a35dbaeee6bdbd85a108d88a982b1a.zip | |
Allow loading modules by 'load-file'
* src/lread.c (Fload): Call 'unbind_to' with 'Fmodule_load' as the
2nd arg, to avoid the "binding stack not balanced" error.
(syms_of_lread) <module-file-suffix>: New Lisp variable.
* lisp/files.el (module-file-suffix): Declare.
(load-file): Remove 'module-file-suffix' from
'completion-ignored-extensions', to allow completion on modules.
* etc/NEWS: Mention 'module-file-suffix'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c index 7f0f1d1f6a8..2239bfc452a 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1164,7 +1164,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1164 | 1164 | ||
| 1165 | #ifdef HAVE_MODULES | 1165 | #ifdef HAVE_MODULES |
| 1166 | if (suffix_p (found, MODULES_SUFFIX)) | 1166 | if (suffix_p (found, MODULES_SUFFIX)) |
| 1167 | return Fmodule_load (found); | 1167 | return unbind_to (count, Fmodule_load (found)); |
| 1168 | #endif | 1168 | #endif |
| 1169 | 1169 | ||
| 1170 | /* Check if we're stuck in a recursive load cycle. | 1170 | /* Check if we're stuck in a recursive load cycle. |
| @@ -4513,6 +4513,13 @@ to the specified file name if a suffix is allowed or required. */); | |||
| 4513 | Vload_suffixes = list2 (build_pure_c_string (".elc"), | 4513 | Vload_suffixes = list2 (build_pure_c_string (".elc"), |
| 4514 | build_pure_c_string (".el")); | 4514 | build_pure_c_string (".el")); |
| 4515 | #endif | 4515 | #endif |
| 4516 | DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix, | ||
| 4517 | doc: /* Suffix of loadable module file, or nil of modules are not supported. */); | ||
| 4518 | #ifdef HAVE_MODULES | ||
| 4519 | Vmodule_file_suffix = build_pure_c_string (MODULES_SUFFIX); | ||
| 4520 | #else | ||
| 4521 | Vmodule_file_suffix = Qnil; | ||
| 4522 | #endif | ||
| 4516 | DEFVAR_LISP ("load-file-rep-suffixes", Vload_file_rep_suffixes, | 4523 | DEFVAR_LISP ("load-file-rep-suffixes", Vload_file_rep_suffixes, |
| 4517 | doc: /* List of suffixes that indicate representations of \ | 4524 | doc: /* List of suffixes that indicate representations of \ |
| 4518 | the same file. | 4525 | the same file. |