Making GNU Emacs play well on Microsoft Windows 7

Emacs 24 has been released, hooray! Here’s how you can download and install it on Windows 7. Bonus tip: pin it to your taskbar so that you can open Emacs easily.

Step 1. Get the Emacs zip file from . You’re looking for something like, or whatever the latest version is. Download and extract the files. I like extracting it to C:\ and renaming the new emacs-24.1 directory to c:\emacs so that I can get to it easily. I’ll assume you’re renaming it too, but if you prefer to keep your Emacs installation elsewhere, just translate the rest of these instructions.

Step 2. Add Emacs to your path. This way, you can start Emacs or emacsclient from anywhere. To change your system path, click on the Windows logo, right-click on Computer, and choose Properties. Click on Advanced system settings, then click on Environment Variables.

If you see a Path variable under User variables, click on it, then click on Edit. Add c:\emacs\bin to the beginning of this path, separating it from the next item with a semicolon. Click OK.

On the other hand, if you don’t see a Path variable under User variables, click on New and add it. The variable name should be Path and the value should be c:\emacs\bin. Click OK.

Step 3. While you’re here, you might as well set your Home variable. This is what Emacs will use whenever you refer to ~, or the home directory. To set that, look under User variables and click on New. Create a variable called HOME, and set the value to whichever directory you would like to use as your home directory. For example, I’ll set mine to c:\sacha. Again, click on OK, then click OK a few more times until you’re done with the System Properties dialog box.

Step 4. All right, let’s start up Emacs! Click on the Windows icon, and type runemacs at the Run prompt. You should see runemacs in the list. If you don’t, you may need to log out and log in so that your new path settings are applied. Once you’ve sorted that out, start runemacs. You should see Emacs open, yay!

Step 5. Want to be able to start up and switch to Emacs quickly? To pin Emacs to your task bar, right-click on the Emacs icon in the task bar. Right-click on the small Emacs icon that appears, and click on Properties. Change the target to c:\emacs\bin\runemacs.exe, and change the start directory to whichever directory you prefer. You can also choose to start it maximized – handy. Once you’ve set that up, click OK. I like dragging the Emacs icon so that it’s the very first item in my task bar. That way, pressing the Windows key and the number 1 at the same time lets me switch to Emacs and away from Emacs easily.

That’s it. Check out for lots of other Emacs bloggers. Happy editing!

One Pingback/Trackback

  • One possible issue with Step 3 and 4 is that HOME is now set for any application. Depending on which other Unix-type applications you’re running, this can be an annoyance. What I do instead is create a shortcut with this destination:

    C:\Windows\System32\cmd.exe /C “set HOME=E:\Shared\Software\emacs-24.1&&E:\Shared\Software\emacs-24.1\bin\runemacs.exe”

    I’ve described this in a bit more detail here, together with my simple .emacs file:

  • Ronnie: Thanks for sharing that! Handy tip.

  • I plan to upgrade on July 2, but I’ve already downloaded the binary.

    Step 2 (modifying PATH) isn’t necessary if you use only shortcuts to invoke Emacs.

    I was going to ask how you use Tag completion in Org. But I just figured it out. By default the keystroke is M-. But as this is the key Windows uses to switch applications, it’s not available to us. Instead, Emacs will accept C-i for , so C-M-i works.

  • Ciaran Mulloy

    Many thanks for the useful information provided in the above article.

    I am trying to work out to replicate the ease of working in Windows (from time to time) that I enjoy in Linux.

    On installing the zip file in your chosen windows folder if you execute the program ‘addpm’ which is located in the ‘bin’ subdirectory of the emacs-24.1 folder this will then add the emacs icon into the program listing (creates a folder called Gnu Emacs containing the Emacs executable). It’s then possible to right click on the executable icon and pin it to task bar or start menu as required.

  • I have most of this set, except for step2 on setting %HOME%. Here I use site-start.el to setenv HOME to a location like /home the advantage being that this thing can be conveniently carried in a usb stick without having to worry about Home environments elsewhere. However tramp seems to somehow expand remote filenames to [email protected]:C:/ , though it works perfectly out of the box if HOME is not set though.

  • Mark Lewin

    Great to see someone posting about Emacs under Windows. In case it helps anyone, I was unable to get the emacs Window to maximize until I put this in my .emacs file:

    ;; Maximizes Emacs in Windows
    (w32-send-sys-command #xf030)

  • Pingback: Making GNU Emacs play well on Microsoft Windows 7 (my additions to Sacha Chuas post) | the cluster of axxllence()

  • Darren Irvine

    Thanks for the start.

  • Enigma0

    Thanks, Sacha. Maybe enjoy a good September weekend at Wasaga Beach? [email protected]

    Win7 acts oddly with emacs, blaring a ‘security warning’ and demanding an admin logon when emacs is started independently. Yet if I select emacs to edit a file, then no ‘warning’.

  • Acharn0

    Before I read the instructions (naturally, I’m a man) I was getting an error message to the effect, “couldn’t create directory /.emacs.d” (sorry, but the tilde key switches my keyboard to Thai). I finally found
    which said the way to set HOME was to edit HKCUSOFTWAREGNUEmacsHOME. Worked like a charm. Then I read (at the GNU site) “To complete the installation process, you can optionally run the program addpm.exe in the bin subdirectory. This will put an icon for Emacs in the Start Menu under “Start -> Programs -> Gnu Emacs”. Wish I’d done that first, I might not have had to mess with editing the registry.

    • That does sound complicated. Thanks for sharing what you learned!

    • That does sound complicated. Thanks for sharing what you learned!

  • Clayton Cramer

    Thank you. Very helpful. I have been using emacs on Unix since the 1980s and I find it too useful to give up.