Icon of a thin page Icon of a thick page

Editing Text Areas Outside the Browser

David A. Harding

A few years ago, my friend Marty Kreuter told me his theory: the quality of writing on web forums sucks because the edit box (text area) is so small. Back then, I rarely wrote in web text areas, but Marty's theory seemed likely. Presently, I use text areas on blogs, reddit.com, and wikis frequently, and I feel my writings in text areas is inferior to my writings elsewhere

GnuJersey.org Bloggers Comment Text Area Size Comparison

Blogger Software CPL Lines CPS
J. LeMasney Wordpress 71 17 1,207
Brian Jones Wordpress 92 11 1,012
Rob Renaud LiveJournal 78 11 858
Mike Kazin LiveJournal 78 11 858
Ed Corrado Wordpress 66 10 660
W. Bilancio MovableType 52 11 572
V. Glinskiy Blogger 42 12 504
J.D. Abolins 20six.co.uk 47 10 470
Greg Haase Wordpress 46 10 460





Fullscreened vi 72 53 3,816
Windowed vi 72 32 2,304

CPL = Characters Per Line
CPS = Characters Per Screen

I know of a solution that I occassionaly use: lynx, the text-mode web browser allows me to edit text areas with the program set in the environmental variable $VISUAL (or $EDITOR or in vi) by tabbing to the text area and pressing Ctrl-e twice. Opening up lynx to a webpage I'm already viewing in Mozilla Firefox is inconvient, and especially so when I need re-login to the website to post the comment.

I found another solution: the somewhat unmaintained Mozex extension to Mozilla Seamonkey and Mozilla Firefox. This extension allows me to configure an editor for editing text areas (I use: aterm-xterm -e nvi) and a keyboard chord (Ctrl-e) to call the extension. When called, Mozex will copy the contents of the text area into a temporary file and run my editor command upon the file. After I've finished writing, I save the file and exit the editor, and Mozex replaces the contents of the text area in Mozilla Firefox with the contents of the temporary file.

Editing text area content in Mozex has 3 flaws so far:

  1. If I use Mozex on a text area, but leave the page the text area is on, Mozex will not replace the contents of the text area with the contents of the temporary file—even if I navigate back to the page. I don't think this problem is severe because Mozex does not close the editor, and so I can copy its contents to a new Mozex editor instance or directly into the text area.
  2. If there is more than one text area on a page, Mozex will always ask me which text area to edit—even if the keyboard input prompt is in a text area. So far I've been able to guess which text area correctly.
  3. My text editor is configured to automatically insert a newline before a line reaches 72 characters, but many text areas, when submitted, turn every newline into a HTML line break. The result is non-flowing text. To fix the problem, I configured a function in my editor to run the following command on the current file to remove all of the extraneous newlines.

    perl -pe 'print "\n" and next if /^$/; s/\n/ /'

I already feel Mozex has raised the quality of my writing in text areas to what I'm used to. Now, I need a tool to stop me from winning all the debates on the internet.