-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IF form is misindented #45
Comments
It is not misindented. Dorai Sitaram's |
If anything, indentation behavior should be configurable as soon as swank indentation is available on Corman CL. (See #43) |
Lispindent's behaviour can be customised as described here https://github.com/ds26gte/scmindent/blob/master/README.adoc. |
Thank you for that clarifying link. I knew I'd seen that type of indentation before in Emacs but didn't have a vanilla install handy. Portacle's approach is non-standard. After comparing the two, along with the explanation in the link you'd provided, the default Emacs way makes more sense. Portacle may disappear as Lispbox and others have, but there will always be good old Emacs to show the way and compare with :-) |
AFAIK, both Portacle and Lispbox depend on the Swank indentation contrib that makes it possible for the Lisp image itself to provide indentation hints to the editor. See https://github.com/slime/slime/blob/master/contrib/swank-indentation.lisp |
@ninejaguar To be fair, the different indentation of the IF form is a matter of taste, nothing more. And it is configurable. I should add some more information into the manual. |
I will consider changing default 'lispindent' behaviour it turns out to be a big deal for many users, although I would rather avoid supporting forked, specialised version of 'lispindent' solely because of this feature. |
I don't know if you'll get the necessary user feedback, but a search on expected indentation for Common Lisp suggests that there's a strong preference to follow whatever Slime/Swank is doing on top of the default Emacs Lisp way of indentation. According to the "Google Common Lisp Style Guide"...
According to the "Lisp-Lang Style Guide"...
According to Robert Strandh's "Symbolic programming using Common Lisp: Indenting Common Lisp"...
|
It seems I have got enough user feedback regarding this matter. OK then, let's try to not deviate from the more common way of indenting IF. Does indenting IF-forms works as expected after executing the following snippet?
P.S. I could not imagine doing this stuff literally 3-hours after the New Year in my timezone. |
Happy New Year! May you and your loved ones enjoy great health and happiness in 2019! It appears that executing the suggested snippet works on the first example below, but the second example may have an issue in the body of the THEN branch as seen in the prog1 form... But, using progn or prog2 instead seems to work... |
It seems that 'lispindent' has some specific rules about indenting PROG1. Actually, I believe, this indentation makes sense. BTW, SLIME/SWANK seems to indent PROG1 and PROG2 forms in exactly the same way. It has nothing to do with indenting IF-form. Anyway, I am not sure that making current indenting engine to work exactly the same way as SLIME/SWANK is what should be done. |
On Tue, Jan 1, 2019 at 4:04 AM ninejaguar ***@***.***> wrote:
OK then, let's try to not deviate from the more common way of indenting IF.
Does indenting IF-forms works as expected after executing the following
snippet?
(setf (cdr (assoc "IF" ide::*lisp-keywords* :test #'string-equal)) -1)
*P.S.*
I could not imagine doing this stuff literally 3-hours after the New Year
in my timezone.
Happy New Year! May you and your loved ones enjoy great health and
happiness in 2019!
It appears that executing the suggested snippet works on the first example
below, but the second example may have an issue in the body of the THEN
branch as seen in the prog1 form...
The PROG1 is indented correctly. The first form should be on the same line
as the PROG1 itself.
The IF indentation which started this thread is not 'old-school'. Only
Elisp has ever been indented that way, and Lisp code indented by a
misconfigured Emacs.
… Reply to this email directly, view it on GitHub
<#45 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADTJ4bUA-chuVZ5hODixbgf5KpwVvJnoks5u-tBIgaJpZM4Zlf-t>
.
|
You're right. It looks like Portacle is indenting similarly based on the following snippet... |
Good to know! Thank you for clarifying. |
I have updated the 3.1 release to include the fix for this issue. |
The
then
andelse
branches should be aligned.The text was updated successfully, but these errors were encountered: