diff --git a/guix/read-print.scm b/guix/read-print.scm index a5a1b708bf2..c8849e767b3 100644 --- a/guix/read-print.scm +++ b/guix/read-print.scm @@ -367,10 +367,9 @@ surrounding SYMBOL." (define (newline-form? symbol context) "Return true if parenthesized expressions starting with SYMBOL must be followed by a newline." - (match (vhash-assq symbol %newline-forms) - (#f #f) - ((_ . prefix) - (prefix? prefix context)))) + (let ((matches (vhash-foldq* cons '() symbol %newline-forms))) + (find (cut prefix? <> context) + matches))) (define (escaped-string str) "Return STR with backslashes and double quotes escaped. Everything else, in diff --git a/tests/read-print.scm b/tests/read-print.scm index ca3f3193f7c..ea52a521457 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm @@ -294,6 +294,11 @@ mnopqrstuvwxyz.\")" ;; page break above end)") +(test-pretty-print "\ +(home-environment + (services + (list (service-type home-bash-service-type))))") + (test-pretty-print/sequence "\ ;;; This is a top-level comment.