There's an add-on for Firefox called "It's All Text!" that lets you edit any browser text area using an external editor, e.g., emacs. Hover the mouse pointer over the text area and an "edit" button appears in the upper right corner which will start the external editor and import the current text. When you save the edited text it's exported back to the browser's text area.