cbaggers / varjo

Lisp to GLSL Language Translator
BSD 2-Clause "Simplified" License
223 stars 23 forks source link

Better indentation of `emit` in geometry stage #231

Closed cbaggers closed 5 years ago

cbaggers commented 5 years ago

mfiano: in a geometry stage, the emit keyword...would be nice if it indented like it had &body instead of:

(emit ()
(* mvp (vec4 (.xy offsets) 0 1))
(.xw extents))
(emit ()
(* mvp (vec4 (.zy offsets) 0 1))
(.zw extents))
(emit ()
(* mvp (vec4 (.xw offsets) 0 1))
(.xy extents))
(emit ()
(* mvp (vec4 (.zw offsets) 0 1))
(.zy extents))
cbaggers commented 5 years ago

I tried a dummy macro and it didnt work

(defmacro emit ((&key point-size) &body data)
  (declare (ignore point-size data))
  (error "Emit is only valid inside shader code"))

Not sure why yet

[edit] from mfiano:

Well I can't confirm, but it is possible that a macro called emit exists somewhere in the lisp image, and SLIME or Sly does not pay attention to the package for semantic indentation purposes.

cbaggers commented 5 years ago

Maybe I should try https://github.com/Shinmera/trivial-indent

cbaggers commented 5 years ago

Oh my bad, indentation does work with that macro, that'll do for now :)