How would one make sure that the .emacs (init file) automatically initializes when you open Emacs?

I am currently running on Windows, if it's relevant. Thus far I have to locate and evaluate the .emacs file every time I open Emacs, despite having package-initialize which is reported to do this automatically.

There are certain packages and customizations that are almost necessary to the "proper" functioning of Emacs, and so it is not hyperbolic to describe this as critical beyond the significant inconvenience it poses.

  • See also this question. Similar problem, it seems (though on GNU/Linux instead of MS Windows).
    – Drew
    Mar 14, 2015 at 16:04
  • As a side note, package-initialize has nothing at all to do with evaluating the init file.
    – phils
    Apr 22, 2017 at 8:15

1 Answer 1


Emacs will load the user-init-file at startup by default, unless you explicitly tell it not to (e.g. with the -Q argument on the command line).

I suspect your .emacs file is in the wrong place. Start Emacs and try C-h v user-init-file to see where Emacs is looking.

See also: https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Location-of-init-file.html#Location-of-init-file

The simplest solution is likely that you need to set a HOME environment variable because Emacs is looking in places you don't expect (as detailed in the FAQ linked above).

  • Thanks for the advice, I will try affect the changes and see once implemented if it has the desired effect. Mar 14, 2015 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.