diff options
| author | Richard M. Stallman | 1996-09-01 00:01:56 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-01 00:01:56 +0000 |
| commit | 04fc68e76970383afb4e3fc6f4069903e51786bc (patch) | |
| tree | 6340be3002b2ee7e1af66c20630e7f9f0b38cbe8 /src | |
| parent | 11c626be442649a0623a235331af98ef6e445f7e (diff) | |
| download | emacs-04fc68e76970383afb4e3fc6f4069903e51786bc.tar.gz emacs-04fc68e76970383afb4e3fc6f4069903e51786bc.zip | |
(Fload): Add "source is newer" info to the "loading" and "done" messages.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/lread.c b/src/lread.c index c1f9a48cfb5..f9b95acc170 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -386,8 +386,10 @@ Return t if file exists.") | |||
| 386 | Lisp_Object temp; | 386 | Lisp_Object temp; |
| 387 | struct gcpro gcpro1; | 387 | struct gcpro gcpro1; |
| 388 | Lisp_Object found; | 388 | Lisp_Object found; |
| 389 | /* 1 means inhibit the message at the beginning. */ | 389 | /* 1 means we printed the ".el is newer" message. */ |
| 390 | int nomessage1 = 0; | 390 | int newer = 0; |
| 391 | /* 1 means we are loading a compiled file. */ | ||
| 392 | int compiled = 0; | ||
| 391 | Lisp_Object handler; | 393 | Lisp_Object handler; |
| 392 | #ifdef DOS_NT | 394 | #ifdef DOS_NT |
| 393 | char *dosmode = "rt"; | 395 | char *dosmode = "rt"; |
| @@ -431,6 +433,8 @@ Return t if file exists.") | |||
| 431 | struct stat s1, s2; | 433 | struct stat s1, s2; |
| 432 | int result; | 434 | int result; |
| 433 | 435 | ||
| 436 | compiled = 1; | ||
| 437 | |||
| 434 | #ifdef DOS_NT | 438 | #ifdef DOS_NT |
| 435 | dosmode = "rb"; | 439 | dosmode = "rb"; |
| 436 | #endif /* DOS_NT */ | 440 | #endif /* DOS_NT */ |
| @@ -439,11 +443,13 @@ Return t if file exists.") | |||
| 439 | result = stat ((char *)XSTRING (found)->data, &s2); | 443 | result = stat ((char *)XSTRING (found)->data, &s2); |
| 440 | if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) | 444 | if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) |
| 441 | { | 445 | { |
| 442 | message ("Source file `%s' newer than byte-compiled file", | 446 | /* Make the progress messages mention that source is newer. */ |
| 443 | XSTRING (found)->data); | 447 | newer = 1; |
| 444 | /* Don't immediately overwrite this message. */ | 448 | |
| 445 | if (!noninteractive) | 449 | /* If we won't print another message, mention this anyway. */ |
| 446 | nomessage1 = 1; | 450 | if (! NILP (nomessage)) |
| 451 | message ("Source file `%s' newer than byte-compiled file", | ||
| 452 | XSTRING (found)->data); | ||
| 447 | } | 453 | } |
| 448 | XSTRING (found)->data[XSTRING (found)->size - 1] = 'c'; | 454 | XSTRING (found)->data[XSTRING (found)->size - 1] = 'c'; |
| 449 | } | 455 | } |
| @@ -460,8 +466,16 @@ Return t if file exists.") | |||
| 460 | error ("Failure to create stdio stream for %s", XSTRING (file)->data); | 466 | error ("Failure to create stdio stream for %s", XSTRING (file)->data); |
| 461 | } | 467 | } |
| 462 | 468 | ||
| 463 | if (NILP (nomessage) && !nomessage1) | 469 | if (NILP (nomessage)) |
| 464 | message ("Loading %s...", XSTRING (file)->data); | 470 | { |
| 471 | if (newer) | ||
| 472 | message ("Loading %s... (compiled; note, source file is newer)", | ||
| 473 | XSTRING (file)->data); | ||
| 474 | else if (compiled) | ||
| 475 | message ("Loading %s... (compiled)", XSTRING (file)->data); | ||
| 476 | else | ||
| 477 | message ("Loading %s...", XSTRING (file)->data); | ||
| 478 | } | ||
| 465 | 479 | ||
| 466 | GCPRO1 (file); | 480 | GCPRO1 (file); |
| 467 | lispstream = Fcons (Qnil, Qnil); | 481 | lispstream = Fcons (Qnil, Qnil); |
| @@ -488,7 +502,15 @@ Return t if file exists.") | |||
| 488 | saved_doc_string_size = 0; | 502 | saved_doc_string_size = 0; |
| 489 | 503 | ||
| 490 | if (!noninteractive && NILP (nomessage)) | 504 | if (!noninteractive && NILP (nomessage)) |
| 491 | message ("Loading %s...done", XSTRING (file)->data); | 505 | { |
| 506 | if (newer) | ||
| 507 | message ("Loading %s...done (compiled; note, source file is newer)", | ||
| 508 | XSTRING (file)->data); | ||
| 509 | else if (compiled) | ||
| 510 | message ("Loading %s...done (compiled)", XSTRING (file)->data); | ||
| 511 | else | ||
| 512 | message ("Loading %s...done", XSTRING (file)->data); | ||
| 513 | } | ||
| 492 | return Qt; | 514 | return Qt; |
| 493 | } | 515 | } |
| 494 | 516 | ||