Mercurial > hg > xemacs-beta
changeset 1733:5903b079bee1
[xemacs-hg @ 2003-10-07 21:52:12 by james]
Use module-extensions instead of an explicit list of module extensions.
author | james |
---|---|
date | Tue, 07 Oct 2003 21:52:26 +0000 |
parents | 2efe1d771c94 |
children | d6d41d23b6ec |
files | lisp/ChangeLog lisp/autoload.el lisp/code-files.el src/ChangeLog src/emodules.c |
diffstat | 5 files changed, 32 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Thu Oct 02 01:18:37 2003 +0000 +++ b/lisp/ChangeLog Tue Oct 07 21:52:26 2003 +0000 @@ -1,3 +1,11 @@ +2003-10-07 Jerry James <james@xemacs.org> + + * autoload.el (generate-c-file-autoloads-1): Use module-extensions + instead of listing the extensions. Use locate-file instead of + explicitly trying each extension. + * code-files.el (load): Use module-extensions instead of an + explicit list of extensions. + 2003-10-02 Steve Youngs <youngs@xemacs.org> * about.el (xemacs-hackers): Remove me.
--- a/lisp/autoload.el Thu Oct 02 01:18:37 2003 +0000 +++ b/lisp/autoload.el Tue Oct 07 21:52:26 2003 +0000 @@ -461,11 +461,9 @@ marked by `generate-c-autoload-cookie' (which see). If FILE is being visited in a buffer, the contents of the buffer are used." - (let ((exists-p-format - "(file-exists-p (expand-file-name \"%s.%s\" module-directory))") - (autoloads-done '()) - ) - + (let ((exists-p-format + "(when (locate-file \"%s\" module-load-path module-extensions)\n") + autoloads-done) (save-excursion (save-restriction (widen) @@ -479,14 +477,7 @@ (if funlist (progn (message "Generating autoloads for %s..." trim-name) - (princ "(when (or\n " outbuf) - (princ (format exists-p-format load-name "ell") outbuf) - (princ "\n " outbuf) - (princ (format exists-p-format load-name "dll") outbuf) - (princ "\n " outbuf) - (princ (format exists-p-format load-name "so") outbuf) - ;; close the princ'd `or' form - (princ ")\n " outbuf) + (princ (format exists-p-format load-name) outbuf) (dolist (arg funlist) (goto-char (point-min)) (re-search-forward @@ -508,14 +499,7 @@ (return-from generate-c-file-autoloads-1 nil)) (message "Generating autoloads for %s..." trim-name) - (princ "(when (or\n " outbuf) - (princ (format exists-p-format load-name "ell") outbuf) - (princ "\n " outbuf) - (princ (format exists-p-format load-name "dll") outbuf) - (princ "\n " outbuf) - (princ (format exists-p-format load-name "so") outbuf) - ;; close the princ'd `or' form - (princ ")\n " outbuf) + (princ (format exists-p-format load-name) outbuf) (while match (forward-line 1) (let ((autoload (make-c-autoload load-name)))
--- a/lisp/code-files.el Thu Oct 02 01:18:37 2003 +0000 +++ b/lisp/code-files.el Tue Oct 07 21:52:26 2003 +0000 @@ -223,15 +223,15 @@ "Execute a file of Lisp code named FILE, or load a binary module. First tries to find a Lisp FILE with .elc appended, then with .el, then with FILE unmodified. If unsuccessful, tries to find a binary module FILE with - .ell appended, then with .dll, then with .so, and finally unmodified. -Searches directories in load-path for Lisp files, and in module-load-path + the elements of `module-extensions' appended, one at a time. +Searches directories in load-path for Lisp files, and in `module-load-path' for binary modules. If optional second arg NOERROR is non-nil, report no error if FILE doesn't exist. Print messages at start and end of loading unless optional third arg NOMESSAGE is non-nil. -If optional fourth arg NOSUFFIX is non-nil, don't try adding - suffixes .elc, .el, or .ell to the specified name FILE. +If optional fourth arg NOSUFFIX is non-nil, don't try adding suffixes + .elc, .el, or elements of `module-extensions' to the specified name FILE. Return t if file exists." (declare (special load-modules-quietly)) (let* ((filename (substitute-in-file-name file)) @@ -275,8 +275,7 @@ ;; The file name is invalid, or we want to load a binary module (if (and (> (length filename) 0) (locate-file filename module-load-path - (and (not nosuffix) - '(".ell" ".dll" ".so" "")))) + (and (not nosuffix) module-extensions))) (if (featurep 'modules) (let ((load-modules-quietly nomessage)) (declare-fboundp (load-module filename)))
--- a/src/ChangeLog Thu Oct 02 01:18:37 2003 +0000 +++ b/src/ChangeLog Tue Oct 07 21:52:26 2003 +0000 @@ -1,3 +1,8 @@ +2003-10-07 Jerry James <james@xemacs.org> + + * emodules.c (vars_of_module): Make Vmodule_extensions visible to + Lisp. Move assignments next to the corresponding declarations. + 2003-09-30 Jerry James <james@xemacs.org> * Makefile.in.in (distclean): xemacs.def.in.in should not be
--- a/src/emodules.c Thu Oct 02 01:18:37 2003 +0000 +++ b/src/emodules.c Tue Oct 07 21:52:26 2003 +0000 @@ -601,6 +601,7 @@ messages. This would normally only be done if `load-module' was being called by a Lisp function. */); + load_modules_quietly = 0; DEFVAR_LISP ("module-load-path", &Vmodule_load_path /* *List of directories to search for dynamic modules to load. @@ -622,21 +623,23 @@ the correctness of a dynamic module, which can have unpredictable results when a dynamic module is loaded. */); + Vmodule_load_path = Qnil; DEFVAR_BOOL ("unloading-module", &unloading_module /* Used internally by `unload-feature'. Do not set this variable. Danger, danger, Will Robinson! */); + unloading_module = 0; - /* #### Export this to Lisp */ - Vmodule_extensions = list4 (build_string (".ell"), + DEFVAR_LISP ("module-extensions", &Vmodule_extensions /* +*List of filename extensions to use when searching for dynamic modules. +*/); + Vmodule_extensions = list5 (build_string (".ell"), build_string (".so"), build_string (".dll"), - build_string (".dylib")); - staticpro (&Vmodule_extensions); + build_string (".dylib"), + build_string ("")); - load_modules_quietly = 0; - Vmodule_load_path = Qnil; Fprovide (intern ("modules")); }