unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#62000: Inconsistent indentation rules for define-configuration
@ 2023-03-06 12:48 Bruno Victal
  2023-03-07 13:16 ` Simon Tournier
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Victal @ 2023-03-06 12:48 UTC (permalink / raw)
  To: 62000

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#62000: Inconsistent indentation rules for define-configuration
  2023-03-06 12:48 bug#62000: Inconsistent indentation rules for define-configuration Bruno Victal
@ 2023-03-07 13:16 ` Simon Tournier
  2023-03-07 13:54   ` Bruno Victal
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Tournier @ 2023-03-07 13:16 UTC (permalink / raw)
  To: Bruno Victal, 62000

Hi,

Cool you had the number 62000. ;-)

On Mon, 06 Mar 2023 at 12:48, Bruno Victal <mirai@makinata.eu> 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?

Well, .dirl-locals.el does not consider the context, IIUC.

For instance,

        (let ((package something))
          (package
            ()
            )
          )

Because of .dir-locals.el, the rules looks like that:

        (not-in-dir-locals.el
         ()
         )

        (package
          ()
          )

        (package/inherit
            ()
          ()
          )

        (add-before
            ()
            ()
          ()
          )

        (let-keywords
            ()
            ()
            ()
          ()
          )

Or you can see that differently,

        (not-in-dir-locals.el ()
                              ()
                              )

        (package ()
                 ()
                 )

        (package/inherit ()
          ()
          )

        (add-before () ()
          ()
          )


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

Cheer,
simon





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#62000: Inconsistent indentation rules for define-configuration
  2023-03-07 13:16 ` Simon Tournier
@ 2023-03-07 13:54   ` Bruno Victal
  2023-03-07 14:02     ` Simon Tournier
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Victal @ 2023-03-07 13:54 UTC (permalink / raw)
  To: Simon Tournier; +Cc: 62000

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 <mirai@makinata.eu> 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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#62000: Inconsistent indentation rules for define-configuration
  2023-03-07 13:54   ` Bruno Victal
@ 2023-03-07 14:02     ` Simon Tournier
  2023-06-22 13:40       ` Bruno Victal
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Tournier @ 2023-03-07 14:02 UTC (permalink / raw)
  To: Bruno Victal; +Cc: 62000

Hi Bruno,

On Tue, 7 Mar 2023 at 14:54, Bruno Victal <mirai@makinata.eu> wrote:

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

As I tried to explain, .dir-locals.el does not consider the context
but only the keyword 'package'.  Because of

   (eval . (put 'package 'scheme-indent-function 0))

each time the word 'package' appears, then it applies the rule.  Maybe
I am missing something but from my point of view, it would not be
possible to change what you are suggesting: apply indentation rules
depending on the context.

Cheers,
simon




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#62000: Inconsistent indentation rules for define-configuration
  2023-03-07 14:02     ` Simon Tournier
@ 2023-06-22 13:40       ` Bruno Victal
  0 siblings, 0 replies; 5+ messages in thread
From: Bruno Victal @ 2023-06-22 13:40 UTC (permalink / raw)
  To: 62000-done; +Cc: zimoun

Hi Simon,

On 2023-03-07 14:02, Simon Tournier wrote:
> I am missing something but from my point of view, it would not be
> possible to change what you are suggesting: apply indentation rules
> depending on the context
Thanks for the explanation, am closing this then.


-- 
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-22 13:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-06 12:48 bug#62000: Inconsistent indentation rules for define-configuration Bruno Victal
2023-03-07 13:16 ` Simon Tournier
2023-03-07 13:54   ` Bruno Victal
2023-03-07 14:02     ` Simon Tournier
2023-06-22 13:40       ` Bruno Victal

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).