[OpenSCAD] Initial implementation of an emacs mode for scad files.

Marius Kintel marius at kintel.net
Wed Mar 31 14:47:55 CEST 2010

On Mar 31, 2010, at 11:58 AM, Len Trigg wrote:

> I had a quick lash at writing an emacs major mode for openscad files.
> It supports font locking and managing indentation etc. I haven't
> written a major mode before, so suggestions (and even better patches)
> are welcome.

I've been using the C++ mode so far, but this looks like a possible improvement!
A few comments/wishes:
o Make indentation indent one extra level if the previous line didn't end with a semicolon.
o Note that it's a difference between functions and modules in scad. Not sure if they need to be indented differently though.

FYI: These are lists of built-in functions and modules in OpensCAD:

"dxf_dim" "dxf_cross" "abs" "min" "max" "sin" "cos" "asin" "acos" "tan" "atan" "atan2" "round" "ceil" "floor" "pow" "sqrt" "exp" "log" "ln" "str" "lookup"

"minkowski" "glide" "subdiv" "child" "echo" "assign" "for" "intersection_for" "if" "union" "difference" "intersection" "dxf_linear_extrude" "linear_extrude" "dxf_rotate_extrude" "rotate_extrude" "import_stl" "import_off" "import_dxf" "group" "cube" "sphere" "cylinder" "polyhedron" "square" "circle" "polygon" "projection" "render" "surface" "scale" "rotate" "mirror" "translate" "multmatrix" "color"

I can add this to a contrib section in subversion once you're ready.

Keep up the good work :)

~/= Marius

We are Elektropeople for a better living.

More information about the Openscad mailing list