From: Richard M. Stallman Date: Sat, 26 Oct 2002 22:41:33 +0000 (+0000) Subject: (command-line): Look for .emacs under ~/.emacs.d after looking in ~. X-Git-Tag: ttn-vms-21-2-B4~12712 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a04d59830e46664faa4d534366a6b07e3b7c12f2;p=emacs.git (command-line): Look for .emacs under ~/.emacs.d after looking in ~. --- diff --git a/lisp/startup.el b/lisp/startup.el index 99de8ff30d1..4ec30fd26b3 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -916,11 +916,23 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (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 user-init-file-1)) + (when (eq user-init-file t) + ;; If we did not find ~/.emacs, try + ;; ~/.emacs.d/.emacs. + (let ((otherfile + (expand-file-name + (file-name-nondirectory user-init-file-1) + (file-name-as-directory + (expand-file-name + ".emacs.d" + (file-name-directory user-init-file-1)))))) + (load otherfile t t) + + ;; If we did not find the user's init file, + ;; set user-init-file conclusively. + ;; Don't let it be set from default.el. + (when (eq user-init-file t) + (setq user-init-file user-init-file-1)))) ;; If we loaded a compiled file, set ;; `user-init-file' to the source version if that