guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indent with emacs batch mode


From: Alex Kost
Subject: Re: indent with emacs batch mode
Date: Sun, 08 Jan 2017 16:32:25 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Ricardo Wurmus (2017-01-07 08:25 +0100) wrote:

> Alex Kost wrote:
>
>> All that stuff can work without 'emacs-guix' (if the line with
>> 'guix-devel-mode' scheme hook will be removed), but in this case the
>> package may not be indented properly.
>
> Guix still comes with a “.dir-locals.el” that specifies the indentation
> rules, doesn’t it?  Can we use that?

Oof, it took me some time to figure it out :-)

So here is the version that requires only emacs and ".dir-locals.el"
file from the git repo:

Attachment: indent-package-expr.el
Description: application/emacs-lisp

Emacs can be run like this:

  emacs -Q --batch -l indent-package-expr.el package-file.scm package-name

The only downside of ".dir-locals.el", is that it doesn't contain
indentation rules for 'modify-phases' keywords (replace, add-after,
add-before).  Maybe they should be added there, but OTOH "replace" looks
like a too general name, so if a user has some code with "replace"
procedure, (s)he wouldn't be pleased when it will be indented strangely.
That's why "guix-devel.el" has a code that indents these keywords only
when they are inside 'modify-phases'.

-- 
Alex

reply via email to

[Prev in Thread] Current Thread [Next in Thread]