Indentation in Emacs of documentation form
Created by: reiniervandijk
It is currently a pain to have a :documentation section indented like (Emacs SLIME mode):
(define-object MyObject ()
:documentation
(:author "me"
:date "2013-01-30"
:version 1
:description "some description")
)
Emacs by default will indent code like:
(define-object MyObject ()
:documentation
(:author "me"
:date "2013-01-30"
:version 1
:description "some description")
)
Imported comments:
By genworks on 2013-01-30 20:46:00 UTC
Also (previously from Issue 55 submitted by reiniervandijk) the indentation is broken for :objects which carry documentation.
Consider:
(define-object MyObject (base-object)
:objects
((MyChild :type 'MyType
:pass-down (something)) ;; <- Correct
)
)
In case one would start adding a documentation string to this child object, the indentation is messed up beyond repair. The :pass-down message argument in this case can not be indented correctly (only with manual whitespaces).
(define-object MyObject (base-object)
:objects
(("Mytype. My Description."
MyChild :type 'MyType
:pass-down (something)) ;; <- Error is here
)
)
By genworks on 2013-01-30 20:50:10 UTC
There are still more questionable indentation rules from the current gdl.el as well, which need to be fixed. They should be listed as comments under this Issue.
By genworks on 2013-02-01 04:22:47 UTC
According to emacs gurus, achieving the first indentation automatically would be extremely difficult.
Suggestion to "punt" and simply drop the first item to the next line:
(define-object MyObject ()
:documentation
(:author
"me"
:date "2013-01-30"
:version 1
:description "some description")
)
Not the best answer I know, and we will leave this issue open for comment.
By genworks on 2013-02-01 04:25:07 UTC
I am not able to replicate the problem for child objects with comments. But I have seen that before. I am not quite sure why but in my development environment I see for example:
(define-object manifold-sample (base-object)
:objects
((box :type 'box-solid
:width 2 :length 2 :height 2)
(merged :type 'merged-solid :other-brep (the box :face-breps :list-elements))
("merge trial"
merged2 :type 'merged-solid
:other-brep (the box :face-breps :list-elements)
:make-manifold? t)))
By reiniervandijk on 2013-02-01 08:00:41 UTC
Hard to judge from github indentation what the results are in your development env. Seems that you are exactly replicating it for merged2, but I might be wrong. The documentation section solution I can live with. In fact, that was exactly what I was doing for each key-value pair (so newline on each list entry).