From f7744227699d27045e87be9eac3464c2f62ff7e3 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 8 Sep 2024 02:00:00 +0200 Subject: [PATCH] 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 --- guix/read-print.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guix/read-print.scm b/guix/read-print.scm index 1f7902c5461..e8caa2cfefd 100644 --- a/guix/read-print.scm +++ b/guix/read-print.scm @@ -604,7 +604,13 @@ FORMAT-VERTICAL-SPACE; a useful value of 'canonicalize-vertical-space'." (display (make-string indent #\space) port)) (let ((column (if newline? indent column))) (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) (loop indent column (or newline? delimited?)