aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts/style.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-08-02 11:57:39 +0200
committerLudovic Courtès <ludo@gnu.org>2022-08-08 11:22:32 +0200
commitf687e27e0385c7f9bab8d967293061158fc3f504 (patch)
tree13ea17d05751f61e8f3b6c6ad057a076ec739488 /guix/scripts/style.scm
parent3eb3901d7f1d4aae134cb64aa703af67c3c27cdf (diff)
downloadguix-f687e27e0385c7f9bab8d967293061158fc3f504.tar
guix-f687e27e0385c7f9bab8d967293061158fc3f504.tar.gz
read-print: Read and render vertical space.
* guix/read-print.scm (<vertical-space>, vertical-space?) (vertical-space, vertical-space-height): New variables. (combine-vertical-space, canonicalize-vertical-space) (read-vertical-space): New procedures. (read-with-comments): Use it in the #\newline case. (pretty-print-with-comments): Add #:format-vertical-space and honor it. Add case for 'vertical-space?'. * guix/scripts/style.scm (format-package-definition): Pass #:format-vertical-space to 'object->string*'. * tests/read-print.scm ("read-with-comments: list with blank line") ("read-with-comments: list with multiple blank lines") ("read-with-comments: top-level blank lines") ("pretty-print-with-comments, canonicalize-vertical-space"): New tests. Add a couple of additional round-trip tests.
Diffstat (limited to 'guix/scripts/style.scm')
-rw-r--r--guix/scripts/style.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 5c0ecc0896..2e14bc68fd 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -316,7 +316,8 @@ PACKAGE."
(object->string* exp
(location-column
(package-definition-location package))
- #:format-comment canonicalize-comment)))))
+ #:format-comment canonicalize-comment
+ #:format-vertical-space canonicalize-vertical-space)))))
(define (package-location<? p1 p2)
"Return true if P1's location is \"before\" P2's."