NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Knowledge > EditingWikiPagesWithEmacs
   Readme | Changes | Index | Search | Go

Problem

I want to edit a wiki page text area using Emacs or gvim.

Solution

Installing the Mozex Extension

NOTE: Mozex does not support Firefox 3. For an alternative, see below.

(This information was supplied by BojanNikolic)

You need to install the `mozex' firefox/mozilla extension like so:

  1. Browse to http://mozex.mozdev.org/index.html
  2. Click on 'Installation'
  3. Scroll down to the *NIX section
  4. Click where it reads "Click here to install mozex."

Important! If nothing happens, scroll to the top of the page and see if there is a message about firefox blocking the installation. If there is, click to 'allow this site', and try again.

I've only bothered to setup the editing of text areas; to do this open the about:config window (by typing this into the address bar) and change the value of the mozex.command.textarea property (if this doesn't exist see #NoMozexProperty) to

/usr/bin/emacsclient %t (to use emacs) or
/usr/X11R6/bin/gvim %t (to use gvim)

Documentation on the various ways you can setup mail/ftp/other programs is at: http://mozex.mozdev.org/arguments.html

OS X Specifics

Due to a bug in Firefox on OS X (https://bugzilla.mozilla.org/show_bug.cgi?id=307463) your favorite text editor needs to be invoked the OS X "open" tool. Hence use something like:

/usr/bin/open -a /Applications/Vim.app %t

in your mozex.command.textarea property to configure Firefox to use vim. (This problem was pointed out to me by Karl Voit ).

Emacs Specific Tweaks

This will allow you to send any text area to a running emacs process. You then need to do two more things:

(i) Have an emacs server process running. Best thing is to put (server-start) at the end of your .emacs file and make sure you are running emacs.
(ii) Follow the 'How to use' instructions below.

Vi/gvim Specific Tweaks

gvim users may wish to add Twiki syntax files and turn off autoindent.

How to Use It?

When you come across a text area you want to edit, right click then select mozex and then edit text area -- this will send the current content of the text area to emacs (or popup a gvim window) and allow you to edit it. When you finish editing make sure you click anywhere in the text area to make the screen update.

Let me know if you run into problems. I found this very useful for wiki's since emacs generally never crashes and if it does the autosaved files can easily be recovered so you can make large changes without worrying about losing everything. Also, things like spell check as you go are useful.

Best, Bojan

I don't see any mozex properties

Some people have reported that they do not see any mozex properties in their about:config window.

With Firefox, you can add the property by right clicking in the main window and selecting "New->String". Once the preference is added edit the value by right clicking on the property and select 'Modify'.

Alternatively exit your browser, and edit the prefs.js file which resides in the mozilla/firefox directory. In my case this directory is something like ~/.mozilla/firefox/.default

The line to add to this file is:

user_pref("mozex.command.textarea", "/usr/bin/emacsclient %t"); (or)
user_pref("mozex.command.textarea", "/usr/X11R6/bin/gvim %t");

You will have to completely shut down all firefox/mozilla applications to be able to permanently edit this file. Hope this helps.

Firefox 3

Mozex does not currently support Firefox 3. Use It's All Text! instead. It works very similarly to Mozex, with the additional benefit of allowing you to choose the extension of the file to be edited (.txt, .html, etc.). This is nice because it allows your editor to put itself in the proper mode.

There is one quirk in the installation process. Install as you would any Firefox extension. Once installed you need to restart Firefox. This is handled by the installer, as usual. But you will need to restart Firefox again after setting the path to your editor in the Preferences dialog box. This is probably a bug, but the extension works great once everything is configured and Firefox is restarted.

-- RichardPrestage - 15 Jun 2005

WebForm
TopicClassification: PublicFAQ
OperatingSystem: OsLinux
OsVersion:

Topic EditingWikiPagesWithEmacs . { Edit | Attach | Ref-By | Printable | Diffs | r1.7 | > | r1.6 | > | r1.5 | More }
Revision r1.7 - 28 Aug 2008 - 18:42 GMT - RamonCreager
Parents: WebHome
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.