Message ID | 20230428191905.13860-5-paren@disroot.org |
---|---|
State | New |
Headers | show |
Series | MATCH-RECORD improvements | expand |
"(" <paren@disroot.org> skribis: > * .dir-locals.el: Treat the fourth form onwards as the body, rather than > the third onwards. Hmm that’s “incorrect”, no? Currently we have: (match-record x <x> (field1 field2 …) body …) Do you mean to move the field list on the first line? Ludo’.
Ludovic Courtès <ludo@gnu.org> writes: > Hmm that’s “incorrect”, no? > > Currently we have: > > (match-record x <x> > (field1 field2 …) > body …) > > Do you mean to move the field list on the first line? Wait, that's intentional? :) With this change, wouldn't it be: ``` (match-record x <x> (field1 field2) body ...) ``` which seems more in line with how other macros with bodies are typically indented.
"(" <paren@disroot.org> skribis: > Ludovic Courtès <ludo@gnu.org> writes: >> Hmm that’s “incorrect”, no? >> >> Currently we have: >> >> (match-record x <x> >> (field1 field2 …) >> body …) >> >> Do you mean to move the field list on the first line? > > Wait, that's intentional? :) With this change, wouldn't it be: > > ``` > (match-record x <x> > (field1 field2) > body ...) > ``` > > which seems more in line with how other macros with bodies are typically > indented. Ah! Dunno, to me the version you’re showing here looks “less natural” because it’s a departure from ‘match’, which was the model here. I understand this is all rather subjective… Ludo’.
Ludovic Courtès <ludo@gnu.org> writes: > Ah! Dunno, to me the version you’re showing here looks “less natural” > because it’s a departure from ‘match’, which was the model here. > > I understand this is all rather subjective… To me, the current indentation conflates the fields expression with the body, which could be confusing for someone who'd never seen a MATCH-RECORD form before. -- (
Hi, "(" <paren@disroot.org> skribis: > Ludovic Courtès <ludo@gnu.org> writes: >> Ah! Dunno, to me the version you’re showing here looks “less natural” >> because it’s a departure from ‘match’, which was the model here. >> >> I understand this is all rather subjective… > > To me, the current indentation conflates the fields expression with the > body, which could be confusing for someone who'd never seen a > MATCH-RECORD form before. Hmm yeah, that makes sense. I’m fine with changing then, as long as ‘.dir-locals.el’ and (guix read-print) implement the same rule. Ludo’.
Ludovic Courtès <ludo@gnu.org> writes: > I’m fine with changing then, as long as ‘.dir-locals.el’ and (guix > read-print) implement the same rule. Ah, good point :)
diff --git a/.dir-locals.el b/.dir-locals.el index a5f627a9ba..3ffd25ee94 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -70,7 +70,7 @@ (eval . (put 'guard 'scheme-indent-function 1)) (eval . (put 'lambda* 'scheme-indent-function 1)) (eval . (put 'substitute* 'scheme-indent-function 1)) - (eval . (put 'match-record 'scheme-indent-function 2)) + (eval . (put 'match-record 'scheme-indent-function 3)) ;; TODO: Contribute these to Emacs' scheme-mode. (eval . (put 'let-keywords 'scheme-indent-function 3))