aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-04 03:00:11 +0000
committerRichard M. Stallman1997-08-04 03:00:11 +0000
commitf0a50954f3d10d256fb27657afbdb00befda1ebb (patch)
tree19716735d814a47b60dfe974153fe833da0cf037
parent1c1e0fe5df9f65f8ee15725724bb8304fb9a4872 (diff)
downloademacs-f0a50954f3d10d256fb27657afbdb00befda1ebb.tar.gz
emacs-f0a50954f3d10d256fb27657afbdb00befda1ebb.zip
(Fload): New optional arg MUST-SUFFIX.
-rw-r--r--src/lread.c13
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 ();
384static Lisp_Object load_unwind (); 384static Lisp_Object load_unwind ();
385static Lisp_Object load_descriptor_unwind (); 385static Lisp_Object load_descriptor_unwind ();
386 386
387DEFUN ("load", Fload, Sload, 1, 4, 0, 387DEFUN ("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\
389First try FILE with `.elc' appended, then try with `.el',\n\ 389First 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\
396If optional fourth arg NOSUFFIX is non-nil, don't try adding\n\ 396If 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\
398If optional fifth arg MUST-SUFFIX is non-nil, insist on adding\n\
399 the suffixe `.elc' or `.el'; don't accept just FILE.\n\
398Return t if file exists.") 400Return 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 }