How do you run Emacs in Windows?
What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?
I use EmacsW32, it works great. EDIT: I now use regular GNU Emacs 24, see below.
See its EmacsWiki page for details.
To me, the biggest advantage is that:
- it has a version of emacsclient that starts the Emacs server if no server is running (open all your files in the same Emacs window)
- it includes several useful packages such as Nxml
- it has a Windows installer or you can build it from sources
And concerning XEmacs, according to this post by Steve Yegge:
To summarize, I’ve argued that XEmacs has a much lower market share, poorer performance, more bugs, much lower stability, and at this point probably fewer features than GNU Emacs. When you add it all up, it’s the weaker candidate by a large margin.
EDIT: I now use regular GNU Emacs 24. It also contains Nxml, can be installed or built from sources, and with this wrapper, the Emacs server starts if no server is running. Cheers!
Note that GNU Emacs for Windows comes with two executables to start Emacs: “emacs.exe” and “runemacs.exe”. The former keeps a DOS-Prompt window in the background, while the latter does not, so when if you choose that distribution and want to create a shortcut, be sure to launch “runemacs.exe”.
Easiest way to find where the user init file is:
C-h v user-init-file
Easiest way to open it is (in the scratch buffer):
and hit C-j to eval
Well, I personally really like what I have been using since I started with Emacs, which is GNU Emacs. It looks like it is built for windows too. That link also answers your .emacs file question. Here is a place you can download it. You should probably get version 22.2 (the latest).
If this is your first time, I hope you enjoy it! I know I absolutely love emacs!
I run it under cygwin. That also gives me a Unix-ish environment for shelling out commands with meta-!
I use a vanilla version of emacs. In my experience, this is very stable, simple, does everything I need, and doesn’t add a bunch of bloat that I don’t need. The .emacs file can be placed in C:\Users\YourName if the HOME environment variable is set. This is a great way to handle it because it works on a user basis and mimics emacs behavior on Linux. You can download the zip from any gnu software repository mirror in the emacs/windows folder. You want the file that is named
There are some great instructions for configuring emacs for windows here. Basically, “installation” boils down to:
- Download emacs from a gnu mirror at emacs/windows/emacs-version-bin-i686-pc-mingw32.zip, and extract the zip to an appropriate folder. Preferably C:\emacs to avoid spaces in the filename.
- Set the HOME environment variable to C:\Users\username (or whatever you want). Make it a user-only variable (if it is username-specific). This is where your .emacs file goes.
- If you want a start menu or desktop shortcut, create a shortcut to bin/runemacs.exe.
- Add c:\emacs\emacs-xx.x\bin\ to your path (user or system), so that you can run it from the command line.
See http://www.gnu.org/software/emacs/windows/ntemacs.html. Section 2.1 describes where to get it, and section 3.5 describes where the .emacs file goes (by default, in your home directory, as specified by the HOME environment variable).
Also, you can consider emacs-w64 for 64bit windows systems:
I’ve run both GNU emacs and Xemacs on windows. I used to use it as my primary editor, email client etc, but not it’s “just” an editor.
When I recently reinstalled to Vista I installed the latest GNU version. It works fine. So does Xemacs, but it does look like GNU have got their sh*t together so Xemacs isn’t as compelling anymore.
I suggest you to use development version of GNU Emacs 23, which is pretty stable and to be released relatively soon. You can get weekly binary builds from the link below.
I have a portable version with .emacs configure ready, which setup org mode, I-do, etc. It also included org sample file. I think that is a better start point for new comers.
Basically run with runemacs.bat and everything is ready.
The best place to start, to get an MS Windows binary for GNU Emacs is … GNU Emacs:
(Oh, and how did I find that URL? From the Emacs manual, node Distribution. If you have access to Emacs anywhere, that’s the place to go for such information.)
On that page you will see everything you need to know about obtaining Emacs. In particular, you will find a section called Obtaining/Downloading GNU Emacs, which links to a nearby GNU mirror. Clicking that link takes you to a page of links that download all Emacs releases since release 21.
More imporantly here, on that page of links you will also see a directory link named windows. Click that to get a page of links to Emacs binaries (executables) for MS Windows. That is the page you want.
Knowing the above information can help when you need to find the page again, if you haven’t bookmarked it. But here is the final URL, directly: http://mirror.anl.gov/pub/gnu/emacs/windows/
When forced to use Windows, I …
Download “Emacs for windows”, and save it in some directory (henceforth referred to as EMACS_SOMEWHERE)
Drop a .cmd file in “Startup” to map, “My Documents” to H: drive with subst, or if “My Documents” resides on a remote server, I use the “Map Network Drive” thing in Explorer to have “My Documents” named H:. Then I create an environment variable named HOME in Windows and give it the name of “H:\”. Now I can drop my .emacs file in “My Documents” and it will be read by emacs when it launches.
Then I create the H:\bin directory. Then I add “H:\bin” to my Windows “Path” environment variable.
Then I create a H:\bin\emacs.cmd file. It contains one line:
@call drive:\EMACS_SOMEWHERE\emacs-23.2\bin\emacsclientw.exe --alternate-editor=c:\programs\emacs-23.2\bin\runemacs.exe -n -c %*
This is a fair bit of work, but it will enable me to run the one and same emacs from either a windows command prompt or from a cygwin command prompt, provided that /cygdrive/h/bin is added to my cygwin PATH variable. Haven’t used this setup for a while but as I recall, when I call the emacs.cmd with a new file over and over, they all end up being buffers in the one and same emacs session.
https://bitbucket.org/Haroogan/emacs-for-windows with the latest Emacs 25, but the whole page has been removed.
The benefit of this build and the emacs-w64 above is that they come with jpg, png, tiff DLLs as well as lxml DLL, which is needed for the new
eww web browser.
To access the .emacs file for your profile the easiest way is to open up emacs. Then do C-x C-, type in ~USERNAME/.emacs (or you can use init.el or one of the other flavours). Type your stuff into the file and C-x C-s (I think) to save it.
The actual file is located (in Windows XP) in c:\Documents and Settings\USERNAME.emacs.d(whatever you named the file), or the equivalent spelling/location on your system.
You can download GNU Emacs NT from here direct. It works fine in windows, make sure you create a shortcut to the runemacs.exe file rather than the emacs.exe file so it doesn’t show a command prompt before opening!
XEmacs is less stable than GNU Emacs, and a lot of extensions are specifically written for GNU. I would recommend GNU > X.
You can place the .emacs file in the root of the drive it’s installed on. Not sure whether you can add it elsewhere too…
Im using emacs32, I only have one problem with it really:
I’ve encountered this problem, and discovered the fault (at least in my case) to be the existence of
c:\site-lisp\site-start.el, a file that was created when EmacsW32 was installed, and which was not removed when I uninstalled it. (Vanilla GNU Emacs for Windows has
c:\site-lisp in its load-path, and will try to load this file, which somehow winds up triggering that error.)
Solution: removing that whole directory (
c:\site-lisp) worked for me, but you should just be able to remove the
If You Mean Emacs as Latex Editor for Windows 7.
Emacs4LS (Emacs 4 Latex Support under Windows 7) for newcomer for Emacs.
- Easy Steps to Install.
- Plugins Built-In.
I prefer to run Emacs in a VM so I have a complete, integrated Linux desktop environment on my Windows machines. My VM of choice is VirtualBox. I export my entire Windows file system to the VM.
If you’re ok with Emacs in a terminal window, and you are running Windows 10, then just run it native using WSL, which just became available in Beta at the end of 2016. Follow the official Microsoft directions. I’m happy with bash (and all of command-line Ubuntu) in WSL.
To give this answer a little more longevity, I’d like to add that the future belongs to containers. I haven’t succeeded in setting up an Emacs container yet. I didn’t try hard, though. Running a command-line Emacs instance in a container is overkill. Activity in the container community is focused on headless apps. You can find the community talking about X11 and VNC for graphical services, e.g. Firefox in a container displaying through VNC. In my opinion, it’s not worth mucking with graphical apps, including Emacs, in containers until the community is more unified on a replacement for X11. Canonical is saying Mir 1.0 will be ready this year, and a “technical preview” was released in Ubuntu 16.04 the same month as Fedora 25 (November 2016). But Wayland is already in Fedora 25. I want to see the dust settle.