diff mbox series

[bug#63135,v2,4/5] dir-locals: Fix MATCH-RECORD indentation.

Message ID 20230428191905.13860-5-paren@disroot.org
State New
Headers show
Series MATCH-RECORD improvements | expand

Commit Message

\( April 28, 2023, 7:19 p.m. UTC
* .dir-locals.el: Treat the fourth form onwards as the body, rather than
  the third onwards.
---
 .dir-locals.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ludovic Courtès May 19, 2023, 3:27 p.m. UTC | #1
"(" <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’.
\( May 20, 2023, 6:02 p.m. UTC | #2
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.
Ludovic Courtès May 24, 2023, 2:11 p.m. UTC | #3
"(" <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’.
\( May 24, 2023, 3:49 p.m. UTC | #4
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.

  -- (
Ludovic Courtès May 26, 2023, 4:41 p.m. UTC | #5
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’.
\( May 27, 2023, 12:55 a.m. UTC | #6
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 mbox series

Patch

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))