Bill Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

May 2006
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Apr  Jun

Firefox for Emacs users

Monday, May 29, 2006

Ok, I have Emacs key bindings burnt into my fingertips. This is both good and bad (see the upcoming lispvan meeting or my earlier "Surviving Emacs" blog entries for info on getting around some of the bad aspects of Emacs use). However, in the course of a typical day's work, I am continually moving my hands from the keyboard to use the mouse for different things. Normally, this isn't too much of a problem, but sometimes it really bugs me. I recently read a blog post written by Luke Gorrie that really resonated with me. In the post, he described how he used the Sawfish window manager to setup his laptop for mostly mouseless operation. In addition to Sawfish, there are other similar "mouseless" window managers available under X Windows (see Ratpoison for another example); however, as far as I'm aware, there are no equivalents for Aqua on Mac OS X (you can run them under X Windows on Mac OS X but I rarely use X Windows on OS X and would prefer something that works with native, Aqua apps). So, I decided to look at alternative ways to minimize my mouse usage.

Now, there are 3 main programs that I use a lot:

  1. Emacs: I use Emacs for Lisp (and other) code development, writing my blog, IRC, reading Usenet and Newsgroups, and a bunch of other "miscellaneous" activities. I spend a lot of time in Emacs.
  2. Firefox: Although I've tried a number of Emacs-based browsers (for example, W3 and W3M), I've never found them very satisfactory. They work well when you're accessing HTML pages that are primarily text, but they don't work well when the HTML page has a lot of images or DIV's or frames. I don't like Sarari or IE much either, so I've standardized on Firefox as my browser of choice.
  3. Proprietary Environment: A lot of the client work I do involves a proprietary development environment and a proprietary DSL. Since this isn't used by most of the readers of this blog, I'll just include it in this list (for completeness), but not talk about what I do to adapt this environment to my work style.
So, a lot of my computer use revolves around the use of two programs: Emacs and Firefox. When I'm working in Emacs, I'm a "happy camper". I can keep my hands on the keyboard (a Kinesis contoured keyboard) and only use the mouse every now and then (although I never really "have" to use the mouse when I'm in Emacs). So, it comes down to Firefox as being the main reason I use a mouse and need to move my hands from the keyboard. Until recently, I just put up with it as I couldn't find any way to minimize mouse usage and still stay productive in the browser (I thought of changing the default Mac OS X key bindings to make them more similar to Emacs key bindings [as described in this article]; however, the problem is more one of Firefox not really being "usable" without a mouse rather than one of not having the "right" key bindings). However, the other day, I came across Conkeror. Conkeror is a Firefox extension that allows you to use the keyboard for almost everything. And, it uses Emacs keybindings for most actions! (actually, there's a VI mode too but I won't talk about that in this post) It's still a bit rough in places (more on that later), but, for the most part, it works really well with just a keyboard. However, documentation is a bit (ahem!) "sparse", so it might help other if I just walk through an example of using it in the remainder of this post (incidentally, the developer is really helpful on the #conkeror IRC channel and there is a mailing list too - both are good resources when you're having problems).

So, here goes - let's start with installation:
  1. I'm assuming that you already have Firefox installed on your box. If not, do that. Don't come back until you are familiar with normal use of Firefox. ;-)
  2. Next, go to the Conkeror installation page. In Step #2 on that page, there is a link to the Conkeror installer. Click on that and accept the install. Then, close down Firefox.
  3. Now, if you're using Linux or Windows, Step #4 on the Conkeror installation page works fine. However, if you're using a Mac with OS X, you want to open a terminal window and type the following:
    /Applications/Firefox.app/Contents/MacOS/firefox -chrome chrome://conkeror/content
    This will open up Firefox with the Conkeror extension loaded. The default page is the "Conkeror User Manual" which consists primarily of a list of the key bindings, some details on the environment and a couple of buttons that allow you to either setup Conkeror as the default or revert back from Conkeror to the standard default for Firefox (Note: this user manual isn't available online; however, it is in CVS. Here is the current version if you just want to browse and see what it looks like without installing Conkeror). Note that there is no toolbar and that all of the links and input-capable objects on the HTML page have numbers next to them. For example, the "NEWS" link has a "6" next to it. So, by pressing the number "6" and pressing "RET", you are taken to that page. Once you are on the NEWS page, pressing "l" (the same command that takes you back to the previous page in Info mode in Emacs) takes you back to the previous page.

    Conkeror User Manual

  4. One thing to note is that, about 3/4 of the way down the "Conkeror User Manual" page, there are two buttons. One is titled "Set Chrome" and the other is titled "Reset Chrome". If you click "Set Chrome", this will configure Conkeror as the default when you start up Firefox. If you subsequently decide that you want to revert to standard Firefox, you can always press "C-h i" in Conkeror to bring up the "Conkeror User Manual" page and select "Reset Chrome". Then, when you next start up Firefox, it will be started without the Conkeror extension. If you choose to use Conkeror by just starting it from the command line (as in step #3 above), it will work mostly ok. However, in Mac OS X, you won't be able to resize the Conkeror window. If you configure it with the "Set Chrome" button and exit and re-start Firefox, then you will be able to resize the browser.
Ok, so you've now got Conkeror installed. Let's say you've just started it up and are sitting on the "Conkeror User Manual" page. Here's an annotated example of a typical session: Another nice thing with Conkeror is that it is "scriptable". You can put your own Javascript customizations in a "conkeror.rcfile" preference file, much like how in Emacs you can create your own customizations in your .emacs file. In this way, you can add your own extensions to Conkeror and add/change key bindings. I can imagine a bunch of user customizations springing up around Conkeror if adoption of the extension becomes popular among Emacs users.

However, Conkeror does still have a few "rough edges" and things that I would like to see changed. Here are a few: I'm sure I'll uncover both additional "gems" and "nits" as I use Conkeror; however, at the moment, I am enjoying my newfound mouseless browsing!

emacs Copyright © 2006 by Bill Clementson