Using itsalltext with emacs/emacsclient

I finally started using It's All Text!— this is something I should done long ago. (It's All Text! is a Firefox extension that lets you invoke an external editor to edit the contents of any textarea element, like this blog post I'm writing right now in Blogger.)

There's such a stark contrast between using Emacs, where I feel at one with the document, and typing in the browser textarea, which always makes me feel kind of claustrophobic now (the problem is not that the textbox is too small, but that it doesn't provide enough degrees of freedom for editing).

If you are using an Emacs with multi-TTY support (a v23 snapshot), you can leave one long-lived Emacs server instance running and quickly pop up a new frame from it for each editing buffer:

  1. From your main Emacs frame, run M-x server-start.
  2. Save the following wrapper script (I called mine ecw) and configure it to be your editor in It's All Text!:
    #!/bin/sh
    /usr/bin/emacsclient -c $@
  3. In the It's All Text! options you can configure your favorite hotkey to launch a new Emacs frame for editing.
  4. When you're done with a buffer, save and press C-x # to return to Firefox.

Update: another tip. To automatically fire up html-mode when editing text from, say, blogger.com, you can add something like this to your .emacs:

(add-to-list 'auto-mode-alist '("/www\\.blogger\\.com\\.[^/]+\\.txt\\'" . html-mode))

This works because the temp file that It's All Text! creates has a name like www.blogger.com.2a2q1e2r32.txt.

2 comments:

  1. Thanks so much for this. I moved to Gmail not long ago, hoping I'd be able to rad it using Gnus and thereby write email with emacs, but it was all too difficult and I've cursed the editing box many times. This is so simple!

    ReplyDelete
  2. With Emacs 22 one could start the client with

    emacsclient -c -a "" -- "$@"

    The -a "" means that it will start Emacs daemon if it doesn't exist already and then connect to that daemon.

    ReplyDelete