From: Gerd Moellmann Date: Fri, 24 Nov 2000 12:29:32 +0000 (+0000) Subject: (command-line): Fix computation of the source file X-Git-Tag: emacs-pretest-21.0.92~98 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9aa5f148cad4ca3166c3eb9b4e96db43c3dea079;p=emacs.git (command-line): Fix computation of the source file for user-init-file when user-init-file is a compiled file. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fc25e4a2d26..0b1989ad4f3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2000-11-24 Gerd Moellmann + + * startup.el (command-line): Fix computation of the source file + for user-init-file when user-init-file is a compiled file. + 2000-11-24 Miles Bader * cus-edit.el (custom-filter-face-spec, custom-pre-filter-face-spec) @@ -21,24 +26,24 @@ * ediff-diff.el: Moved variables around to have it compile under NT. - * ediff-help.el (ediff-use-long-help-message): made it customizable. + * ediff-help.el (ediff-use-long-help-message): Made it customizable. - * ediff-init.el (ediff-abbrev-jobname): use capitalize. + * ediff-init.el (ediff-abbrev-jobname): Use capitalize. - * ediff-wind.el (ediff-skip-unsuitable-frames): deleted the + * ediff-wind.el (ediff-skip-unsuitable-frames): Deleted the redundant skip-small-frames test. - * viper-cmd.el (viper-change-state-to-vi): disable overwrite mode. + * viper-cmd.el (viper-change-state-to-vi): Disable overwrite mode. (viper-downgrade-to-insert): protect against errors in hooks. - * viper-init.el (viper-vi-state-hook,viper-insert-state-hook, - viper-replace-state-hook,viper-emacs-state-hook): do cursor handling. - (viper-restore-cursor-type,viper-set-insert-cursor-type): new + * viper-init.el (viper-vi-state-hook,viper-insert-state-hook) + (viper-replace-state-hook,viper-emacs-state-hook): Do cursor handling. + (viper-restore-cursor-type,viper-set-insert-cursor-type): New functions. - * viper-util.el (viper-memq-char): bug fixes. + * viper-util.el (viper-memq-char): Bug fixes. - * viper.el (viper-mode): fix cursor handling. + * viper.el (viper-mode): Fix cursor handling. 2000-11-24 Kenichi Handa diff --git a/lisp/startup.el b/lisp/startup.el index 8cc24039b12..5ee789657da 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -828,24 +828,31 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ;; into user-init-file. (setq user-init-file t) (load user-init-file-1 t t) + ;; If we did not find the user's init file, ;; set user-init-file conclusively to nil; ;; don't let it be set from default.el. (if (eq user-init-file t) (setq user-init-file nil)) + ;; If we loaded a compiled file, set ;; `user-init-file' to the source version if that ;; exists. (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)) + "elc")) + (let* ((source (file-name-sans-extension user-init-file)) + (alt (concat source ".el"))) + (setq source (cond ((file-exists-p alt) alt) + ((file-exists-p source) source) + (t nil))) + (when source + (when (file-newer-than-file-p source user-init-file) + (message "Warning: %s is newer than %s" + source user-init-file) + (sit-for 1)) + (setq user-init-file source)))) + (or inhibit-default-init (let ((inhibit-startup-message nil)) ;; Users are supposed to be told their rights.