mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
read-print: Attempt to indent package arguments less.
* guix/read-print.scm (pretty-print-with-comments): Add an exception to the rule that values immediately follow keywords, when printing G-expressions within package arguments. Change-Id: I214a096701c87ab8bc34ab79e357dcb56e2db334
This commit is contained in:
parent
30719e5ef1
commit
f774422769
1 changed files with 7 additions and 1 deletions
|
@ -604,7 +604,13 @@ FORMAT-VERTICAL-SPACE; a useful value of 'canonicalize-vertical-space'."
|
||||||
(display (make-string indent #\space) port))
|
(display (make-string indent #\space) port))
|
||||||
(let ((column (if newline? indent column)))
|
(let ((column (if newline? indent column)))
|
||||||
(print tail
|
(print tail
|
||||||
(keyword? item) ;keep #:key value next to one another
|
(and (keyword? item) ;keep #:key VALUE next to one another
|
||||||
|
;; An exception to which is a G-expression immediately
|
||||||
|
;; following a package argument such as #:phases.
|
||||||
|
(match tail
|
||||||
|
((('gexp . _) . _)
|
||||||
|
(not (prefix? '(list arguments package) context)))
|
||||||
|
(_ #t)))
|
||||||
(blank? item)
|
(blank? item)
|
||||||
(loop indent column
|
(loop indent column
|
||||||
(or newline? delimited?)
|
(or newline? delimited?)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue