0

I'm trying to do a basic setup of emacs on my Windows 10 machine. I've used emacs in the past on an Ubuntu system.
When I try to make a init.el file in an emacs.d directory it turns my .el file into a .txt file, which then of course isn't read by emacs when loading.

When going to my emacs.d folder I right click, choose New, then choose Text Document which I then rename an .el file. That seems to work in the tutorials i've watched.

Any help is appreciated !

1
  • 3
    On windows it helps if you set the file explorer to show extensions, then you can rename including the extension. Is there any reason why you don't create the file with emacs itself?
    – rsp
    May 22, 2022 at 7:04

1 Answer 1

3

I think you need to configure Explorer to display file extensions. But I may be wrong: I don't know much about Windows. In any case, this is an Emacs site, so I'll give an Emacs solution. Anyway doing this outside Emacs only makes this harder.

In Emacs, just open the file you want. If the file doesn't exist, Emacs will create it the first time you save. Press C-x C-f (i.e. Ctrl+X followed by Ctrl+F) and type

~/.emacs.d/init.el

then press Enter. The ~ at the beginning stands for your home directory. An advantage of doing this from within Emacs is that you're sure this is the place Emacs uses as your home directory — on Windows, there are several places where Emacs's idea of the home directory could be.

Put whatever you want in the file and save with C-x C-s. The next time you start Emacs, it will read your new init file.

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.