Mercurial > emacs
comparison lisp/startup.el @ 33850:4cc1de4931b9
(command-line): Fix computation of the source file
for user-init-file when user-init-file is a compiled file.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 24 Nov 2000 12:27:11 +0000 |
parents | 4161fec906e0 |
children | 29bb0c0782b1 |
comparison
equal
deleted
inserted
replaced
33849:0219e791e0a6 | 33850:4cc1de4931b9 |
---|---|
826 (concat "~" init-file-user "/.emacs"))))) | 826 (concat "~" init-file-user "/.emacs"))))) |
827 ;; This tells `load' to store the file name found | 827 ;; This tells `load' to store the file name found |
828 ;; into user-init-file. | 828 ;; into user-init-file. |
829 (setq user-init-file t) | 829 (setq user-init-file t) |
830 (load user-init-file-1 t t) | 830 (load user-init-file-1 t t) |
831 | |
831 ;; If we did not find the user's init file, | 832 ;; If we did not find the user's init file, |
832 ;; set user-init-file conclusively to nil; | 833 ;; set user-init-file conclusively to nil; |
833 ;; don't let it be set from default.el. | 834 ;; don't let it be set from default.el. |
834 (if (eq user-init-file t) | 835 (if (eq user-init-file t) |
835 (setq user-init-file nil)) | 836 (setq user-init-file nil)) |
837 | |
836 ;; If we loaded a compiled file, set | 838 ;; If we loaded a compiled file, set |
837 ;; `user-init-file' to the source version if that | 839 ;; `user-init-file' to the source version if that |
838 ;; exists. | 840 ;; exists. |
839 (when (and user-init-file | 841 (when (and user-init-file |
840 (equal (file-name-extension user-init-file) | 842 (equal (file-name-extension user-init-file) |
841 "elc") | 843 "elc")) |
842 (file-exists-p user-init-file-1)) | 844 (let* ((source (file-name-sans-extension user-init-file)) |
843 (when (file-newer-than-file-p | 845 (alt (concat source ".el"))) |
844 user-init-file-1 user-init-file) | 846 (setq source (cond ((file-exists-p alt) alt) |
845 (message "Warning: %s is newer than %s" | 847 ((file-exists-p source) source) |
846 user-init-file-1 user-init-file) | 848 (t nil))) |
847 (sit-for 1)) | 849 (when source |
848 (setq user-init-file user-init-file-1)) | 850 (when (file-newer-than-file-p source user-init-file) |
851 (message "Warning: %s is newer than %s" | |
852 source user-init-file) | |
853 (sit-for 1)) | |
854 (setq user-init-file source)))) | |
855 | |
849 (or inhibit-default-init | 856 (or inhibit-default-init |
850 (let ((inhibit-startup-message nil)) | 857 (let ((inhibit-startup-message nil)) |
851 ;; Users are supposed to be told their rights. | 858 ;; Users are supposed to be told their rights. |
852 ;; (Plus how to get help and how to undo.) | 859 ;; (Plus how to get help and how to undo.) |
853 ;; Don't you dare turn this off for anyone | 860 ;; Don't you dare turn this off for anyone |