]> git.eshelyaron.com Git - emacs.git/commitdiff
(command-line): Fix computation of the source file
authorGerd Moellmann <gerd@gnu.org>
Fri, 24 Nov 2000 12:29:32 +0000 (12:29 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 24 Nov 2000 12:29:32 +0000 (12:29 +0000)
for user-init-file when user-init-file is a compiled file.

lisp/ChangeLog
lisp/startup.el

index fc25e4a2d2660e4d37be1c52ac56f0ddd397182a..0b1989ad4f3162c2fd56b67f07ff056b12cc528c 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-24  Gerd Moellmann  <gerd@gnu.org>
+
+       * 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  <miles@gnu.org>
 
        * cus-edit.el (custom-filter-face-spec, custom-pre-filter-face-spec) 
        
        * 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  <handa@etl.go.jp>
 
index 8cc24039b12d3e365f90506da8e01ef0d6bdf1ae..5ee789657dad6eeeb5a91e46d5c58bba4ab5e25b 100644 (file)
@@ -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.