indent-code.el is not aware of (package (inherit ...)) style

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Robert Vollmert
Owner
unassigned
Submitted by
Robert Vollmert
Severity
normal
R
R
Robert Vollmert wrote on 16 Jun 2019 09:07
(address . bug-guix@gnu.org)
4F2510DB-73D5-4817-804B-21F065E9DE26@vllmrt.net
When encountering a package definition that starts

(package (inherit other-package))

etc/indent-code.el will indent the rest of the package body
to align with the start of (inherit. That seems to be a
common idiom, used in roughly half of the instances:

guix/gnu/packages$ git grep '(inherit ' | wc -l
905
guix/gnu/packages$ git grep '(inherit ' | grep package | wc -l
425
L
L
Ludovic Courtès wrote on 17 Jun 2019 11:39
(name . Robert Vollmert)(address . rob@vllmrt.net)(address . 36240@debbugs.gnu.org)
878su01rgr.fsf@gnu.org
Hi Robert,

Robert Vollmert <rob@vllmrt.net> skribis:

Toggle quote (13 lines)
> When encountering a package definition that starts
>
> (package (inherit other-package))
>
> etc/indent-code.el will indent the rest of the package body
> to align with the start of (inherit. That seems to be a
> common idiom, used in roughly half of the instances:
>
> guix/gnu/packages$ git grep '(inherit ' | wc -l
> 905
> guix/gnu/packages$ git grep '(inherit ' | grep package | wc -l
> 425

It’s a corner case, and one of the reasons I (and others, I think) are
now usually writing:

(package
(inherit p)
…)

I’m not sure we can teach Emacs the other rule; maybe sometimes we have
to accept limitations like this one. :-)

Ludo’.
?