Subject: Re: bug#62000: Inconsistent indentation rules for define-configuration

From: Bruno Victal <[email-masked]>
Date: Tue, 7 Mar 2023 13:54:41 +0000

Hi Simon,

On 2023-03-07 13:16, Simon Tournier wrote:
> Hi,
> 
> Cool you had the number 62000. ;-)
> 
> On Mon, 06 Mar 2023 at 12:48, Bruno Victal <[email-masked]> wrote:
>> Suspected file: .dir-locals.el
>>
>> Using 'package' as a field in define-configuration results in
>> inconsistent indentation: 
>>
>> --8<---------------cut here---------------start------------->8---
>> (define-configuration/no-serialization mympd-configuration
>>   (package
>>     (file-like mympd)        ;;;; <<<<<<<<<<<<<<<<<<<<< notice how it's indented with 2 spaces
>>     "The package object of the myMPD server."
>>     empty-serializer)
>>
>>   (shepherd-requirement
>>    (list-of-symbol '())      ;;;; <<<<<<<<<<<<<<<<<<<<< vs 1 space
>>    "This is a list of symbols naming Shepherd services that this service
>> will depend on."
>>    empty-serializer)
>>
>> ;; ...
>> )
>> --8<---------------cut here---------------end--------------->8---
> 
> What do you mean by inconsistent?  Do you think that
> ’sheperd-requirement’ should be management by .dir-locals.el?

It's not 'shepherd-requirement' that should be managed by .dir-locals.el, it could have been named something else.

Compare with 'mympd-ip-acl':

--8<---------------cut here---------------start------------->8---
(define-configuration/no-serialization mympd-ip-acl
  (allow
   (list-of-string '())
   "Allowed IP addresses.")

  (deny
   (list-of-string '())
   "Disallowed IP addresses."))
--8<---------------cut here---------------end--------------->8---

It's uniformly indented.

> Well, since ’sheperd-requirement’ is not in .dir-locals.el, the
> indentation seems expected.  What do you consider as a bug?

Having a field named 'package' within define-configuration causes incorrect indentation.

Cheers,
Bruno.