Re: indenting the documentation string



Tamas Papp <tkpapp@xxxxxxxxx> writes:

I wonder what is the "proper" way to handle indentations and
linebreaks in documentation strings. If I just keep typing and press
C-Q, SLIME will indent it like this:

(defun foo (x)
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat."
(1+ x))

Then (describe 'foo) gives:

Function documentation:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat.

It is OK for the function documentation to start with a 2-space
indentation, and none after that?

One of several possible thoughts on this:

I would hope that doc systems handle the availability of multi-string
doc, since it's permitted in the language.

(defun foo (x)
"abc" ; doc
"def" ; doc
(foo) ; body
"xyz" ; body
(bar) ; body
"baz" ; body
)

I like to think the way these would be joined in doc is
with an intervening newline, since that supports the obvious use
and the visual effect. I doubt many people want to or do use

(defun foo (x)
"this" " " "is" " " "a" " " "comment"
(foo))

- - - -

This happens not to be the solution I use, nor that I prefer.
But I think it should be an option, and it's rarely mentioned in
discussions like this, so I'm posting it to see what other say
about the notion.
.