Mercurial > hg > xemacs-beta
comparison lisp/code-files.el @ 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 | 68169b2a743e |
children | a0adf5f08c44 |
comparison
equal
deleted
inserted
replaced
1732:2efe1d771c94 | 1733:5903b079bee1 |
---|---|
221 | 221 |
222 (defun load (file &optional noerror nomessage nosuffix) | 222 (defun load (file &optional noerror nomessage nosuffix) |
223 "Execute a file of Lisp code named FILE, or load a binary module. | 223 "Execute a file of Lisp code named FILE, or load a binary module. |
224 First tries to find a Lisp FILE with .elc appended, then with .el, then with | 224 First tries to find a Lisp FILE with .elc appended, then with .el, then with |
225 FILE unmodified. If unsuccessful, tries to find a binary module FILE with | 225 FILE unmodified. If unsuccessful, tries to find a binary module FILE with |
226 .ell appended, then with .dll, then with .so, and finally unmodified. | 226 the elements of `module-extensions' appended, one at a time. |
227 Searches directories in load-path for Lisp files, and in module-load-path | 227 Searches directories in load-path for Lisp files, and in `module-load-path' |
228 for binary modules. | 228 for binary modules. |
229 If optional second arg NOERROR is non-nil, | 229 If optional second arg NOERROR is non-nil, |
230 report no error if FILE doesn't exist. | 230 report no error if FILE doesn't exist. |
231 Print messages at start and end of loading unless | 231 Print messages at start and end of loading unless |
232 optional third arg NOMESSAGE is non-nil. | 232 optional third arg NOMESSAGE is non-nil. |
233 If optional fourth arg NOSUFFIX is non-nil, don't try adding | 233 If optional fourth arg NOSUFFIX is non-nil, don't try adding suffixes |
234 suffixes .elc, .el, or .ell to the specified name FILE. | 234 .elc, .el, or elements of `module-extensions' to the specified name FILE. |
235 Return t if file exists." | 235 Return t if file exists." |
236 (declare (special load-modules-quietly)) | 236 (declare (special load-modules-quietly)) |
237 (let* ((filename (substitute-in-file-name file)) | 237 (let* ((filename (substitute-in-file-name file)) |
238 (handler (find-file-name-handler filename 'load)) | 238 (handler (find-file-name-handler filename 'load)) |
239 (path nil)) | 239 (path nil)) |
273 buffer-file-coding-system-for-read) | 273 buffer-file-coding-system-for-read) |
274 )))) | 274 )))) |
275 ;; The file name is invalid, or we want to load a binary module | 275 ;; The file name is invalid, or we want to load a binary module |
276 (if (and (> (length filename) 0) | 276 (if (and (> (length filename) 0) |
277 (locate-file filename module-load-path | 277 (locate-file filename module-load-path |
278 (and (not nosuffix) | 278 (and (not nosuffix) module-extensions))) |
279 '(".ell" ".dll" ".so" "")))) | |
280 (if (featurep 'modules) | 279 (if (featurep 'modules) |
281 (let ((load-modules-quietly nomessage)) | 280 (let ((load-modules-quietly nomessage)) |
282 (declare-fboundp (load-module filename))) | 281 (declare-fboundp (load-module filename))) |
283 (signal 'file-error '("This XEmacs does not support modules"))) | 282 (signal 'file-error '("This XEmacs does not support modules"))) |
284 (and (null noerror) | 283 (and (null noerror) |