From 90ef692e9b48732ae2e3921ff5d101e186506a85 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 2 Aug 2022 17:39:55 +0200 Subject: read-print: 'canonicalize-comment' leaves top-level comments unchanged. This lets users use three leading semicolons, for instance, in top-level comments. * guix/read-print.scm (canonicalize-comment): Add INDENT parameter and honor it. (pretty-print-with-comments): Change default value of #:format-comment. Call FORMAT-COMMENT with INDENT as the second argument. * tests/read-print.scm: Adjust test accordingly. --- tests/read-print.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/read-print.scm b/tests/read-print.scm index 94f018dd44..e3f23194af 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm @@ -274,6 +274,7 @@ mnopqrstuvwxyz.\")" (test-pretty-print/sequence " ;;; Hello! +;;; Notice that there are three semicolons here. (define-module (foo bar) #:use-module (guix) @@ -286,7 +287,8 @@ mnopqrstuvwxyz.\")" (locale \"eo_EO.UTF-8\") (services - (cons (service mcron-service-type) %base-services)))\n") + (cons (service mcron-service-type) %base-services)))\n" + #:format-comment canonicalize-comment) (test-equal "pretty-print-with-comments, canonicalize-comment" "\ -- cgit v1.2.3