From: Gerd Moellmann Date: Tue, 23 May 2000 22:03:27 +0000 (+0000) Subject: (command-line): Determine source file of compiled X-Git-Tag: emacs-pretest-21.0.90~3773 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c047136e1966ef32be1a83ecbab0d394a8858a24;p=emacs.git (command-line): Determine source file of compiled user init file differently. Warn if compiled user init file is older than its source file. --- 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'." ;; If we loaded a compiled file, set ;; `user-init-file' to the source version if that ;; exists. - (if (and user-init-file - (equal (file-name-extension user-init-file) - "elc")) - (let ((el (concat (file-name-sans-extension - user-init-file) - ".el"))) - (if (file-exists-p el) - (setq user-init-file el)))) + (when (and user-init-file + (equal (file-name-extension user-init-file) + "elc") + (file-exists-p user-init-file-1)) + (when (file-newer-than-file-p + user-init-file-1 user-init-file) + (message "Warning: %s is newer than %s" + user-init-file-1 user-init-file) + (sit-for 1)) + (setq user-init-file user-init-file-1)) (or inhibit-default-init (let ((inhibit-startup-message nil)) ;; Users are supposed to be told their rights.