diff options
| author | Gerd Moellmann | 2000-05-23 22:03:27 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-05-23 22:03:27 +0000 |
| commit | c047136e1966ef32be1a83ecbab0d394a8858a24 (patch) | |
| tree | f77c882aeea740ac29dea611b544b71eb0188ac1 | |
| parent | f95c3f91250537d195a754ed9730e9578c4df978 (diff) | |
| download | emacs-c047136e1966ef32be1a83ecbab0d394a8858a24.tar.gz emacs-c047136e1966ef32be1a83ecbab0d394a8858a24.zip | |
(command-line): Determine source file of compiled
user init file differently. Warn if compiled user init file
is older than its source file.
| -rw-r--r-- | lisp/startup.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 510a529581e..575e961bd59 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -697,14 +697,16 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 697 | ;; If we loaded a compiled file, set | 697 | ;; If we loaded a compiled file, set |
| 698 | ;; `user-init-file' to the source version if that | 698 | ;; `user-init-file' to the source version if that |
| 699 | ;; exists. | 699 | ;; exists. |
| 700 | (if (and user-init-file | 700 | (when (and user-init-file |
| 701 | (equal (file-name-extension user-init-file) | 701 | (equal (file-name-extension user-init-file) |
| 702 | "elc")) | 702 | "elc") |
| 703 | (let ((el (concat (file-name-sans-extension | 703 | (file-exists-p user-init-file-1)) |
| 704 | user-init-file) | 704 | (when (file-newer-than-file-p |
| 705 | ".el"))) | 705 | user-init-file-1 user-init-file) |
| 706 | (if (file-exists-p el) | 706 | (message "Warning: %s is newer than %s" |
| 707 | (setq user-init-file el)))) | 707 | user-init-file-1 user-init-file) |
| 708 | (sit-for 1)) | ||
| 709 | (setq user-init-file user-init-file-1)) | ||
| 708 | (or inhibit-default-init | 710 | (or inhibit-default-init |
| 709 | (let ((inhibit-startup-message nil)) | 711 | (let ((inhibit-startup-message nil)) |
| 710 | ;; Users are supposed to be told their rights. | 712 | ;; Users are supposed to be told their rights. |