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:
- 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.
- 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.
- 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, here goes - let's start with installation:
- 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. ;-)
- 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.
- 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.

- 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.
- press "g" or "C-x C-f": The prompt asks you for the URL. Enter "www.google.com" RET. You'll notice that, on the Google page, the cursor is positioned in the text box. Although the Conkeror control keys will still work in the text box, the shortcut keys (like "g" to go to a URL) won't work. If you wanted to get out of the text box to enter a shortcut command, you would need to press "Esc" first. Let's say you've heard of a Lisp book by a guy named Peter Seibel but can't remember the details.
- enter "peter seibel" RET: After entering "peter seibel" in the text box and pressing "RET", you get the search results. Note that each link has a number next to it. In my case, the entry for the Amazon book page for Peter Seibel's Practical Common Lisp book is 34, so I type "34" and press RET. Reading through the "Download Description" portion of the Amazon page, there is a phrase that begins with the words "Developed in 1959 by John McCarthy,...". So, say that (as I'm reading the book description) I decide to do a web search on the words "John McCarthy".
- press "f7": Pressing "f7" enters "caret mode" and you have
a visible cursor on the HTML page. You can now use the normal Emacs
cursor movement keys to move the cursor to the words "John
McCarthy". Or, you can use "C-s" to do an incremental search for "John McCarthy". Once
you've positioned to the words "John McCarthy" and highlighted them,
you can use the normal Emacs "M-w" key sequence to copy the text. Then press "l" to
move back to the previous page (which is the Google search page). The cursor will be in
the search string box. Press "C-y" to paste the text into the search
string and press RET to search the web for "John McCarthy". The
first link is John McCarthy's home page, so type in the number
corresponding to that link and press RET.

John McCarthy's page is displayed - note that the page is shown with numbered links. Although this is the default, sometimes you don't want to see the numbers as they might distract from the content of the page. - press "M-l": That toggles the numbered links. If you want to
read a page without seeing a number next to each link, pressing
"M-l" will toggle between displaying the numbers and not
displaying them.

- "C-h i" and "C-h b": At any time, I can press "C-h i" to
bring up the Conkeror help page and I can press "C-h b" to bring up
a page that lists all of the key bindings. Some other
commonly-used key bindings are:
- C-x r l: List bookmarks
- R: Refresh/redraw
- etc: quite a few common Emacs key bindings are supported!
However, Conkeror does still have a few "rough edges" and things that I would like to see changed. Here are a few:
- Sometimes, for no known reason, the Conkeror window loses focus under Mac OS X. You can try to Cmd-Tab to another window and back again; however, you still can't get any keyboard response until you actually click in the window with the mouse. I've spoken to the developer about this and it is a known issue. Actually, it is probably a Firefox issue but not one that would normally be noticed by other (non-Conkeror) users since other people would normally be using a mouse in Firefox.
- On Mac OS X in Conkeror, the Meta key is bound to the Cmd key. In Emacs, I have Alt configured as Meta. I would prefer for this to be configurable rather than hard-coded. The developer said that he may change this so that it is a config option.
- There is no toolbar and no ability to access one. Although you can create your own commands (so nothing that you have on the toolbar can't be done by a Conkeror command), sometimes you might want to just "mouse around" and it would be nice to be able to turn on the toolbar for those scenarios.

