Learning Emacs – part 2: the emacs user interface

In part 1 of this series, we looked at installing emacs. This time, lets get acquainted with the emacs user interface.

The emacs user interface

Below is a screenshot of an average emacs screen with several noteworth elements labeled.

Emacs screen

The first two elements of note are the menubar and toolbar. These are pretty much the same as what you’re used to from any other GUI application, but don’t let that fool you into thinking that emacs works like any other GUI application! The first rule for understanding and learning emacs: Emacs is old. It’s been around since the pre-historic days of computing, and learning to use emacs will sometimes feel like a journey back in time. Gnu Emacs comes from a time before graphical user interfaces were common. Mouse support, menus, and limited graphics capabilities have been grafted onto it over the years, but at it’s heart, emacs is still a text mode console application. You have to understand that to ever understand emacs.

Emacs is a relic from another era. You have to accept or reject it on it’s own terms. It is not, and will probably never be more than superficialy similar to any of the other applications you probably use. In a later installment, I’ll show you how to disable the menubar and toolbar. I know that sounds crazy, but IMHO it’s essential that you force yourself to learn emacs on its own terms.

The next noteworthy UI element is the minibuffer. It’s the seemingly blank line at the very bottom of the emacs window. The minibuffer is where you’ll enter longer commands, and where you’ll enter arguments to commands that require arguments. A simple example would be using the C-x C-f command to open a file. The minibuffer area is where you’ll be prompted to enter a filename. (if you don’t know what C-x C-f means yet, don’t worry. We’ll go over that soon.

The final major UI element we’ll talk about is the modeline. The modeline contains a number of useful pieces of status information, including the name of the current buffer (usually the name of the file being edited in the buffer), the current modes (major mode and minor modes), the current position of the cursor in the buffer, amount of the buffer displayed on screen, etc.

That’s it for this installment. Next time we’ll start getting hands on with some basic commands including cursor movement, insertion and deletion, etc.

______
Other installment in this series: part one, part two, part three, and part four.

Learning Emacs – part 1: Introduction, entering emacs, and exiting emacs

So I’ve decided to learn Emacs. I’ve always been more of a Vi man previously, and I still consider some moderate amount of comfort with Vi to be a necessity for any Unix sysadmin. I’ve also used a few of the major IDE’s for programming: I use Eclipse with RadRails for all of my Ruby development, a friend who’s trying to get me to learn Java has introduced me to NetBeans, and I’ve played a bit with C# in Visual Studio.

So why learn Emacs? Well, there are a so many people on the net who swear by Emacs, including some who otherwise seem to be very sensible and non-masochistic. 🙂 It’s also supposed to be the environment of choice for Lisp and Scheme programming, which is something I’d like to learn more about. So, operating under the principle that “where there’s smoke there may be fire”, I’m going to give Emacs a chance and see if I can learn enough of it to at least stand it. 🙂

I’m starting with installing Gnu Emacs under Cygwin. I won’t go into details on how to install Cygwin, as I think that’s covered quite completely elsewhere (specifically in the Cygwin documentation), although I may do a later post on how I’ve customized my Cygwin environment to make it more comfortable and more usable. What am going to do, is document my experiences learning Emacs, and what I’ve learned.

Under Cygwin, emacs is installed in the usr\bin directory under the cygwin directory (on my system “c:\cygwin\usr\bin”).

To start emacs from a shell prompt, just type “emacs” or you can type “emacs filename.txt” to open a file (in this case, called filename.txt). In a later installment of this series, we’ll look at how to open files from within an already started emacs.

To exit emacs use “C-x C-c”, which mean to hold down the “Control” key while hitting the “x” key, then hold down the “Control” key while hitting the “c” key.

Under Cygwin, there’s also a startmenu shortcut conveniently created by the Cygwin setup program. Or if you’re really smart, you can use Launchy (like I do). 🙂

If you’ve got X installed (which you should), you’ll get a graphical emacs like this:

Emacs in X

If you’re not running X, you’ll get a slightly less friendly looking version of Emacs, like this:

Emacs

There’s also a native Win32 Emacs version.

From what I remember of being a Mac version, you could get Gnu Emacs from Fink, or there are some native Aqua ports of Emacs.

If you’re a Linux user then it should of course be easy to get a copy of Gnu Emacs from your preferred Linux distribution. 🙂

Next time, we’ll talk about actually using the damn thing. 🙂

______
Other installment in this series: part one, part two, part three, and part four.

Launchy

I just noticed today that Launchy has had a fairly major upgrade and is now at version 1.0.

The new version adds support for plugins, and some of the new plugins add the ability to browse and open folders, and to browse and open FireFox bookmarks (not sure if IE is supported), and the ability to search some popular internet sites (google, wikipedia, etc) directly from Launchy.

Launchy has still got a ways to go before it’s as good as QuickSilver is on the Mac, but the Launchy team seems to be making some decent progress. IMHO it’s probably the best QuickSilver substitute for people on Windows.

Open Source Paradigm Shift

Last night I read Tim O’Reilly’s new article “The Open Source Paradigm Shift”. There’s a lot of good stuff in there, and I would definitely recommend it to anyone with an interest in Open Source or even just with an interest in where the IT industry is going.

The article has one of the best explanations I’ve seen of how Open Source software doesn’t reduce value, it helps to create value for the industry as a whole. Open Source software may be accelerating the commoditization of the software industry, but that commoditization was inevitable with or without Open Source.

There’s also some interesting stuff in there about network effects, and how the Open Source development process, Ebay, and Amazon all successfully leverage network effects in similar, but different ways.

For all that I like about the article, there is one point where I hope that O’Reilly is wrong. He says:

The values of the free and open source community are an important part of its paradigm. Just as the Copernican revolution was part of a broader social revolution that turned society away from hierarchy and received knowledge, and instead sparked a spirit of inquiry and knowledge sharing, open source is part of a communications revolution designed to maximize the free sharing of ideas expressed in code.

…..

The lessons of previous paradigm shifts show us a more subtle and powerful story than one that merely pits a gift culture against a monetary culture, and a community of sharers versus those who choose not to participate. Instead, we see a dynamic migration of value, in which things that were once kept for private advantage are now shared freely, and things that were once thought incidental become the locus of enormous value.

To me, the revival of the gift culture is *the* most important part of the Free Software Movement. I hope that the “broader social revolution” that Free Software is part of isn’t just about “a communications revolution”. I hope that it’s about a rediscovery of the values of community, of working together toward a common goal. I hope that it’s about realizing that not everything in life needs to be about money and not everything in life needs to be directed by our employer, the government, or a “corporate sponsor”. We’re more than just “consumers”, or “eyeballs”, or even citizens. We’re people. And people can and should work together, help one another, and sometime even build something wonderful.