Install Emacs on Windows
Tags: #emacs #windows
In this post, we will see how to install Emacs on Windows, while creating an init.el configuration file, and configuring the Windows HOME environment variable necessary to find it.
Let’s go…
Download the .zip file containing Emacs from the FTP https://ftp.gnu.org/gnu/emacs/windows/ or from the mirror https://mirror.cyberbits.eu/gnu/emacs/windows/
At the time of writing this post, the latest available version is 30.1. The file to download is therefore emacs-30.1.zip (159 MB)
Unzip it in the directory of your choice, for example within C:/programs2/emacs-30.1/
The subdirectories will then typically be:
C:/programs2/emacs-30.1/bin
C:/programs2/emacs-30.1/include
C:/programs2/emacs-30.1/lib
etc…
Create a desktop shortcut pointing to C:\programs2\emacs-30.1\bin\emacs.exe
Double-click on the shortcut to run it. Emacs should launch.

To close Emacs: File > Quit menu or the keyboard shortcut Ctrl-x Ctrl-c
At this stage, Emacs is installed. :)
One important thing remains to be done: indicate to Emacs the correct location of the future configuration file init.el
Emacs will look for it in the directory designated by ~, which by default under Windows represents an unlikely directory, for example C:\Users\username\AppData\Roaming, which is often the last place where we want to store a configuration file.
(Advanced users can know the location of this default directory by at least three methods: (i) (expand-file-name "~") (ii) (getenv "HOME") or (iii) M-x dired then choose the ~ directory by typing ~ directly just after the proposed directory.)
Let’s suppose we want to store configuration files in the same directory as Emacs (but we can do it elsewhere): C:\programs2\emacs-30.1\
Let’s create a Windows (user) environment variable named HOME with the content C:\programs2\emacs-30.1\
In C:\programs2\emacs-30.1\, let’s now create a .emacs.d directory, and, in this directory, an init.el file with the following content:
(message "Here is init.el file. Emacs version is %s" (emacs-version))
Let’s close Emacs (File > Quit in the menus or Ctrl-X Ctrl-C keyboard shortcut) and restart it.
No visible change should be noticed.
Let’s now display the content of the Messages buffer, for example through the Buffers menu or through the keyboard shortcut Ctrl-x Ctrl-b. The buffer content should show the text
Here is init.el file. Emacs version is […]
… which proves that our init.el file has been properly loaded.

This init.el file will be able to accommodate all the configuration instructions we wish… but that’s another story, or rather the story of a lifetime of refinement :D