Commit c047136e authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(command-line): Determine source file of compiled

user init file differently.  Warn if compiled user init file
is older than its source file.
parent f95c3f91
...@@ -697,14 +697,16 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ...@@ -697,14 +697,16 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
;; If we loaded a compiled file, set ;; If we loaded a compiled file, set
;; `user-init-file' to the source version if that ;; `user-init-file' to the source version if that
;; exists. ;; exists.
(if (and user-init-file (when (and user-init-file
(equal (file-name-extension user-init-file) (equal (file-name-extension user-init-file)
"elc")) "elc")
(let ((el (concat (file-name-sans-extension (file-exists-p user-init-file-1))
user-init-file) (when (file-newer-than-file-p
".el"))) user-init-file-1 user-init-file)
(if (file-exists-p el) (message "Warning: %s is newer than %s"
(setq user-init-file el)))) user-init-file-1 user-init-file)
(sit-for 1))
(setq user-init-file user-init-file-1))
(or inhibit-default-init (or inhibit-default-init
(let ((inhibit-startup-message nil)) (let ((inhibit-startup-message nil))
;; Users are supposed to be told their rights. ;; Users are supposed to be told their rights.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment