An Emacs major mode for Notation 3: n3-mode

Search the scratchpad:  

Emacs window with an N3 buffer

Editing Notation 3 documents without any kind of syntax highlighting rapidly becomes difficult.

This is why I started an major mode for Emacs for Notation 3 documents.

What n3-mode should do

n3-mode should help people in the following ways:

What n3-mode currently does

It currently only does syntax highlighting, and not all the grammar describe in the documentation is reflected.

This basically is a first try.

Dowloading n3-mode

n3-mode.el is available for you to play with. Comments, contributions are welcome.

Using n3-mode

The following is from Dave Pawson.

Add the following to your .emacs file.

;;
;; n3 mode
;;

(add-to-list 'load-path "{path}/n3-mode.el")
(autoload 'n3-mode "n3-mode" "Major mode for OWL or N3 files" t)

;; Turn on font lock when in n3 mode
(add-hook 'n3-mode-hook
          'turn-on-font-lock)

(setq auto-mode-alist
      (append
       (list
        '("\\.n3" . n3-mode)
        '("\\.owl" . n3-mode))
       auto-mode-alist))

Replace {path} with the full path to n3-mode.el on your system.

If you want to make it load just a little faster;

C-x f n3-mode.el
M-x byte-compile-file n3-mode.el