diff options
| author | Richard M. Stallman | 1997-08-04 03:00:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-04 03:00:11 +0000 |
| commit | f0a50954f3d10d256fb27657afbdb00befda1ebb (patch) | |
| tree | 19716735d814a47b60dfe974153fe833da0cf037 | |
| parent | 1c1e0fe5df9f65f8ee15725724bb8304fb9a4872 (diff) | |
| download | emacs-f0a50954f3d10d256fb27657afbdb00befda1ebb.tar.gz emacs-f0a50954f3d10d256fb27657afbdb00befda1ebb.zip | |
(Fload): New optional arg MUST-SUFFIX.
| -rw-r--r-- | src/lread.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lread.c b/src/lread.c index 60583bafbb2..e6cc2b7b074 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -384,7 +384,7 @@ static void readevalloop (); | |||
| 384 | static Lisp_Object load_unwind (); | 384 | static Lisp_Object load_unwind (); |
| 385 | static Lisp_Object load_descriptor_unwind (); | 385 | static Lisp_Object load_descriptor_unwind (); |
| 386 | 386 | ||
| 387 | DEFUN ("load", Fload, Sload, 1, 4, 0, | 387 | DEFUN ("load", Fload, Sload, 1, 5, 0, |
| 388 | "Execute a file of Lisp code named FILE.\n\ | 388 | "Execute a file of Lisp code named FILE.\n\ |
| 389 | First try FILE with `.elc' appended, then try with `.el',\n\ | 389 | First try FILE with `.elc' appended, then try with `.el',\n\ |
| 390 | then try FILE unmodified.\n\ | 390 | then try FILE unmodified.\n\ |
| @@ -395,9 +395,11 @@ Print messages at start and end of loading unless\n\ | |||
| 395 | optional third arg NOMESSAGE is non-nil.\n\ | 395 | optional third arg NOMESSAGE is non-nil.\n\ |
| 396 | If optional fourth arg NOSUFFIX is non-nil, don't try adding\n\ | 396 | If optional fourth arg NOSUFFIX is non-nil, don't try adding\n\ |
| 397 | suffixes `.elc' or `.el' to the specified name FILE.\n\ | 397 | suffixes `.elc' or `.el' to the specified name FILE.\n\ |
| 398 | If optional fifth arg MUST-SUFFIX is non-nil, insist on adding\n\ | ||
| 399 | the suffixe `.elc' or `.el'; don't accept just FILE.\n\ | ||
| 398 | Return t if file exists.") | 400 | Return t if file exists.") |
| 399 | (file, noerror, nomessage, nosuffix) | 401 | (file, noerror, nomessage, nosuffix, must_suffix) |
| 400 | Lisp_Object file, noerror, nomessage, nosuffix; | 402 | Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; |
| 401 | { | 403 | { |
| 402 | register FILE *stream; | 404 | register FILE *stream; |
| 403 | register int fd = -1; | 405 | register int fd = -1; |
| @@ -432,7 +434,10 @@ Return t if file exists.") | |||
| 432 | if (XSTRING (file)->size > 0) | 434 | if (XSTRING (file)->size > 0) |
| 433 | { | 435 | { |
| 434 | GCPRO1 (file); | 436 | GCPRO1 (file); |
| 435 | fd = openp (Vload_path, file, !NILP (nosuffix) ? "" : ".elc:.el:", | 437 | fd = openp (Vload_path, file, |
| 438 | (!NILP (nosuffix) ? "" | ||
| 439 | : ! NILP (must_suffix) ? ".elc:.el" | ||
| 440 | : ".elc:.el:"), | ||
| 436 | &found, 0); | 441 | &found, 0); |
| 437 | UNGCPRO; | 442 | UNGCPRO; |
| 438 | } | 443 | } |