/cfdg3-mode

This is an Emacs mode for editing Context Free Design Grammar (CDFG) files.

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

Context Free Design Grammar Mode for Emacs

This is an Emacs mode for editing Context Free Design Grammar files, aka CFDG files.

This project was inspired by the cfdg-mode posted by Brent Sanders at the Context Free Art Forums. This project share no code with Mr. Sanders’ mode, though. Therefore, any error are our own.

Introduction

/Context Free Art/ is am amazing program that generates images from context-free grammars, defined in Context Free Design Grammar syntax.

I am starting to play with CFDG and wanted syntax highlight for my scripts, but I could not find an editor with support for CFDG Version 3. So I decided to give it a try and write my on Emacs mode for it. It is the first time I try to do such a thing, so do not expect much, but if you find this mode useful, please be welcome to use it – at your own risk, notice that right now, this is pre-alpha software :-).

Quick Intall

Put the cfdg3-mode.el file into your Emacs load path and add the following into your Emacs init file (~/.emacs, ~/.emacs.d/init.el, etc.)

(require 'cfdg3-mode)
(autoload 'cfdg3-mode "cfdg3-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.cfdg\\'" . cfdg3-mode))

To Do

As Mr. Xah Lee wrote in his tutorial on writing Emacs’s major modes:

A full featured language mode should also handle comments, indentation, keyword completion, function documentation lookup, function template insertion, graphical menu, supporting emacs’s customize-group scheme, or any other features that may be useful for coding the language your mode is designed for.

So, we wish for the future:

  • Handle comments.
  • Handle indentations.
  • Keyword completion.
  • Function documentation search.
  • Graphical menu.
  • Support for Emacs’ customize-group scheme.
  • Rendering and viewing of images in Emacs.

Known Issues

  • Multiline comments are not highlighted properly.
  • The transform shape adjustment is not highlighted properly. This is due to a conflict with the transform control structure.
  • The if function is note highlighted properly. This is due to a conflict with the if control structure.

The End