Skip to content
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

Too much horizontal indentation #72

Open
jackfirth opened this issue Sep 20, 2024 · 0 comments
Open

Too much horizontal indentation #72

jackfirth opened this issue Sep 20, 2024 · 0 comments

Comments

@jackfirth
Copy link
Contributor

jackfirth commented Sep 20, 2024

fmt currently formats this code:

(void
 (thread
  (λ ()
    (let loop ()
      (define vec (sync evt))
      (define str (vector-ref vec 1))
      (when (regexp-match #rx"^cm: *compil(ing|ed)" str)
        (display str)
        (newline))
      (loop)))))

Into this:

(void (thread (λ ()
                (let loop ()
                  (define vec (sync evt))
                  (define str (vector-ref vec 1))
                  (when (regexp-match #rx"^cm: *compil(ing|ed)" str)
                    (display str)
                    (newline))
                  (loop)))))

The original is much more readable to me. This is related to the discussion in racket/drracket#678 about how fmt prioritizes minimizing vertical space over minimizing indentation. In the (void (thread ...)) case, things are a bit simpler because each of those forms has exactly one subform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant