Skip to content
No description or website provided.
Emacs Lisp ooc
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Emacs major mode for ooc-lang, tested support for emacs 23.2 and up. Support for lower versions is untested!

Quick setup

Into a directory of your choice do…

git clone git://

Take the full path of this directory, for example:

cd ooc-mode/ && pwd

Edit your ~/.emacs or ~/.emacs.d/init.el (whichever you have) with emacs and include the lines:

(add-to-list 'load-path "<output of pwd above>")
(require 'ooc-mode)
(require 'flymake-ooc)

These last two lines depend on 23.2 and up.

(semantic-mode 1)
(global-semantic-idle-summary-mode 1)

Tell emacs to reload that buffer with:

M-x eval-buffer RET

Turn flymake ooc on as normal with: M-x flymake-ooc-mode RET.


Currently working:

  • automatic tab indention (still a few bugs…)
  • complex syntax highlighting.
    • Properly handle oocdoc comments.
      • Exact syntax of oocdoc statements is still up in the air, thus ooc-mode will not be implementing this part of ooc-doc until it is a little clearer what the final syntax will look like.
  • With flymake-ooc: instant compiler information seconds after you screwup on a line.


ooc-mode supports “projects”. Right now this means syntax checking works properly even when including and using functions from a complex project with multiple source directories like oos.

Due to a rock bug with symlinks, it is imperative that you be using a rock version from git to use this feature! Make sure your version of rock is at or newer then nddrylliog/rock revision: 03c0478.

To set this up:

  • M-x customize-option RET ooc-projects RET
  • Add a project name, whatever you like is good here.
  • Add a project root directory. This should be a directory leading to the base or top level of your project. Whatever you call it, it is generally where your copyright licenses and README goes.
  • Add rock options by clicking the nearby insert button and filling in the blanks.
    • To refer to related include modules for the project supply -sourcepath=Path/To/Include. Keep these relative to your root directory.
    • If you have an ooc sdk library be sure to add this as a sourcepath as well. Currently flymake-ooc will recognize and properly handle -sourcepath=<stuff> paths. Please file feature requests for additional path options as rock adds more, or you find one missing here.
  • Open a file inside your project and in that buffer do: M-x flymake-ooc-init. Provided the configuration is correct and you are using a recent rock from git syntax checking work project wide.


Installing yasnippet with ooc-mode gives template completion. Yasnippet is an external package, so there is a small amount of extra work in getting this setup. Install by following these steps:

cd ~/.emacs.d/plugins
svn checkout yasnippet

Open your ~/.emacs and add the following to the end of it:

(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas/load-directory "~/.emacs.d/plugins/yasnippet/snippets")
(yas/load-directory "/path/to/ooc-mode/snippets")

The last line should point to snippets/ in this repository. By v0.3 there will be a way to customize that last load-directory in the ooc customize group.

Please understand this whole snippets thing is alpha quality and may break unexpectedly in future updates until v0.3 is released.

Current templates

Just a little example of what is created so far. The expansions here may not be the same as what current HEAD has, but the general forms will remain the same. The name you type before hitting tab to expand a template is the header of each grouping below.


<classname>: class {
    <your code here>


<covername>: cover {
    <your code here>


<funcnamehere>: func -> <typehere> {
    <your code here>


for(<i> := 0; <i> < <upto_var>; <i> += 1) {
    <your code here>


match <thing> {
    case <matching_value> => <your code here>

other snippets

Expands to traditional while loop.
Expands to if statement with no else clause.
Expands to case <match> => <your code here>

Key word summaries

For these be sure to add after the other ooc-mode configuration lines in ~/.emacs the following: (also added at the default config at top)

(semantic-mode 1)
(global-semantic-idle-summary-mode 1)

Thanks to gmaster1440 (Mark Fayngersh) for nearly all of the current summaries.

Bugs, issues, problems…

Please use the issues tab to report any issues.

Something went wrong with that request. Please try again.