Setting Up emacs And Other Open Source Applications in Windows

One of my grievances against the mouth-foaming Linux advocates who get crazy doe-eyed about how much free software is available via repository packages is that nearly all that same software is also available for use in Windows. That means one really needn’t change operating systems to take advantage of open source software. I think people who are already comfortable using Windows and have valid licenses shouldn’t change — certainly not so they can use software already available to them.

I run a lot of the same software across platforms because I find it convenient to be able to share data regardless of which operating system I may be using at any given moment (which is important because I use XP primarily on my Aspire One and have no plans to stop using it until I can get Linux working at the same level and with the same stability). I have GIMP, OpenOffice.org, Sylpheed, Firefox, PuTTY, Filezilla, Audacity, emacs, and a lot more free and open source software running under XP on my Aspire One. And it’s not just these kinds of desktop applications that are available. Windows users can take advantage of server software like Apache and all the usual languages — PHP, Ruby, Lua, python, Perl, etc. — to use on their servers. There are only a handful of open source desktop and server applications that won’t run on Windows or that don’t offer a Windows binary of some sort.

As easy as it is to install these things in Windows, sometimes things are a little easier to find and/or use in one operating system compared to others. For example, Windows’ filesystems and applications don’t like starting file names with a period; Unix-like operating systems, though, use period-starting names to hide files and directories. That’s not to say you can’t have a dot-file on a Windows system. By convention, applications with a Unix-like focus can use a file or directory started with an underscore rather than a dot (e. g., _emacs in Windows is like .emacs in Linux). These differences can make things a little more complicated depending where you’re most comfortable.

Another thing that needs to be addressed is where various directories and files are located. The standard file hierarchies of Windows and Unix-like systems are similar in layout but different with respect to naming conventions. Where Linux and BSD have /home/$USER for each USER’s own files, Windows uses “My Documents” for each user.

Many open source applications put their configuration files in the directory preceding “My Documents.” This directory is usually found at “C://Documents and Settings/user name” which can be accessed by hitting the  up-directory arrow from “My Documents” or sequentially in the path above starting at “My Computer.” Some applications put configuration data in a hidden directory at this level called “Application Data.”

Windows uses a different convention to hide directories and files (accessible via Properties). You can choose Tools-Options-View in the file browser to toggle whether or not to show hidden files and directories. Or you can navigate to whatever file (e. g., .emacs) by opening a file (C-x C-f) and editing the path (tab completion works) to the file; emacs can reach “hidden” files and directories under Windows without altering settings mentioned above in the file browser. You can also name or rename your files with a dot from within emacs despite Windows’ preferences.

(The Windows naming convention is tied to legacy 8.3 naming conventions in which the dot is a demarcation between file name and file type.)

All of this is important because applications like emacs can be personalized very heavily via their configuration files. Sometimes these files need to be interacted with via interface menus available in the applications themselves. Sometimes they need to be edited manually. The latter is true of the .emacs file, which is a LISP file. (Another myth to shoot down: not all open source applications are configured via text file so YMMV. They can be anything from XML to interpreted languages to binary.)

The location of the .emacs/_emacs file can vary depending how emacs was installed.  The easiest way to find it is to use emacs itself to show the path it’s using for environmental variables. To do this, you can use the emacs LISP interpreter within the scratch buffer.

emacs-windows-env-find

The next step is to execute the command using C-x C-e. You’ll get the path where your .emacs.d directory is stored along with where your .emacs should be.

emacs-windows-env-found

Once you know where your .emacs is, you can set it up as you need. While emacs already has some built-in associations, you can either add new ones or alter existing ones. One of my favorite tools in emacs, org-mode, requires some set up in .emacs (see the org-mode documentation). It’s kind of awkward that something is bundled in emacs but you have to tell emacs that your .org files need to be opened in org-mode when other filetypes (html) are opened with an appropriate mode.

org-mode-collapsed

Things work better when you set up your .emacs to handle file types the way you want. Rather than opening a .org file as a standard text file, for example, it can be opened so that it’s in org-mode. Your .emacs also controls other modes and tools within emacs, including e-mail and news as well as just about anything you want to do with it (emacs is a kitchen sink).

org-mode-expanded

There are many guides to setting up .emacs and other open source application configuration files online. The more you know, the better you can make software work for you.

Advertisements

One Response to “Setting Up emacs And Other Open Source Applications in Windows”

  1. Setting Up emacs And Other Open Source Applications in Windows … | Open Hacking Says:

    […] rest is here:  Setting Up emacs And Other Open Source Applications in Windows … This entry was posted on Saturday, June 20th, 2009 at 11:32 am and is filed under Linux, News, […]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: