Ox-mode for Emacs

Alternative ox-mode

ox-mode is a major mode for emacs, used for editing Ox source files. It provides syntax highlighting (aka font-lock), compile mode, imenu support (to list functions in the current buffer), a menu bar, and basic debugging support. Ox is an econometric programming language, available from http://www.doornik.com/products.html#Ox.

I've only tested this package in emacs 22 (prerelease) and XEmacs 21.4.19 on Windows. Please let me know if you have problems or fixes for other platforms. Note that the package is based heavily on the "derived-mode-ex.el" example code for cc-mode extensions.

Steps:

This was motivated by the original ox-mode from Michael Höhle (http://www.dina.kvl.dk/~hoehle/software/ox/ox-mode.txt). That approach (which applies diffs to the original cc-mode files in emacs) didn't seem to work well for new versions of emacs.

In ox files, this will automatically add the keybindings "control-c o" to run the current buffer through the ox interpreter, or "control-c p" to parse the buffer without running it (to check for syntax errors). Both functions are available from a menu. The menu bar also includes an "OxFunctions" item that lists all functions in the current buffer, so you can skip to a function definition by selecting its corresponding menu item. This will only work smoothly if you put a function name and argument list on one line followed by an open brace at the beginning of the next line. You can turn this off by setting "ox-use-imenu" to nil.

. You can choose a different ox interpreter path (the default is just "oxl") with (customize-variable "ox-binary-path"). If your ox code has errors, you'll be able to use the normal emacs "next-error" functions to jump to the appropriate lines.