Indenting forms nested inside FLET, MACROLET, and LABELS
Opened this issue · 0 comments
I noticed lispindent
is implicitly assigning a LIN value of 0
to FLET
forms, while I would have expected a 1
instead; now, I understand that there is no right or wrong here, but I never seen FLET
, MACROLET
, or LABELS
forms getting indented that way, so I thought about flagging this.
For example, let's take the following snippet:
(flet ((hello ()
(format t "Hello, World!~&")))
(hello))
Pass it to lispindent
and you will get back:
(flet ((hello ()
(format t "Hello, World!~&")))
(hello))
Anyway, by adding the current word to LPAREN
and inspecting the call stack to figure out what the surrounding form is (see: iamFIREcracker@4902a57), I managed to fix the indentation of these forms; however, even though it all seems to be working fine, I don't think I quite like the fact that the solution relies on a new variable, *labels-keywords*
, that users have no control over, but could not figure out a nice way to reuse the .lispwords
.
Let me know you your thoughts.