diff --git a/doc/guix.texi b/doc/guix.texi index 35e5883308..07dd00a7c2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -44702,7 +44702,9 @@ available for the configuration record. @var{sub-documentation} is a @code{(@var{field-name} @var{configuration-name})} tuple. @var{field-name} is the name of the field which takes another configuration record as its value, and -@var{configuration-name} is the name of that configuration record. +@var{configuration-name} is the name of that configuration record. The +same value may be used for multiple @var{field-name}s, in case a field +accepts different types of configurations. @var{sub-documentation} is only needed if there are nested configuration records. For example, the @code{getmail-configuration} record diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index d2b1687496..e76ad5e8cb 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2021 Andrew Tropin ;;; Copyright © 2022 Maxime Devos ;;; Copyright © 2023 Bruno Victal +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -460,8 +461,12 @@ (define (show-default val) (para ,@field-docs) ,@(append-map generate - (or (assq-ref sub-documentation field-name) - '()))))) + (filter-map + (match-lambda + ((name config) + (and (eq? name field-name) + config))) + sub-documentation))))) fields))))))) (stexi->texi `(*fragment* . ,(generate documentation-name))))