guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 4/4] gnu: Add python-requests-mock.


From: Taylan Ulrich Bayırlı/Kammer
Subject: Re: [PATCH 4/4] gnu: Add python-requests-mock.
Date: Tue, 15 Sep 2015 19:32:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Andreas Enge <address@hidden> writes:

> Hello,
>
> On Tue, Sep 15, 2015 at 06:54:51PM +0200, Mathieu Lirzin wrote:
>>    (sha256
>>     (base32
>>      "..."))
>
> like someone else previously on this list I was also puzzled by the discussion
> on formatting style (meaning, I did not understand what the indentation to
> apply or to avoid is), so I wonder if there are actual rules to be formulated
> and applied in case of manual formatting. My impression so far was that
> indentation is usually by 2 spaces. So does this mean we now indent only by 1,
> or does it depend on the context?

Emacs will use 2 spaces when the symbol (e.g. sha256 in this case) has
its 'scheme-indent-function' property set, and 1 space otherwise.  So
you get

    (let (...)
      foobar)  ;two spaces because 'let has its 'scheme-indent-function
               ;set to 1 (meaning *one* argument is "special", here the
               ;list of bindings)

and

    (display
     (string-append
      foobar
      quux))  ;one space each because they're plain functions and have
              ;no 'scheme-indent-function property set

Under Guix's sources, the .dir-locals.el file contains expressions of
the form (put 'foo 'quux value), which insert properties into symbols.
(Here the 'foo symbol gets its 'quux property set.)  Symbols appearing
there, like for instance 'with-store or 'modify-phases or 'substitute*
should probably have their arguments 2-space indented, and others
1-space, since that's what Emacs will do automatically.

By the way, shall you put a newline directly before the "special"
argument of such a form, e.g. the bindings-list of a let expression,
then you use 4 spaces for the "special" argument:

    (let
        (...)
      foobar)

    (modify-phases
        %standard-phases
      (replace 'foo bar)
      ...)

And also, as you might have noticed, it's mostly macros that get their
'scheme-indent-function set.  I don't know if this rule is enforced
under Guix.

Taylan



reply via email to

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