From 922d59a242646c2488738d77263580427bd7764b Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Tue, 26 Jul 2011 11:55:24 +0200 Subject: [PATCH] Produces better error messages when one forgets to document a property. Now, error messages are produced if a property's type is not defined. --- scm/documentation-lib.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scm/documentation-lib.scm b/scm/documentation-lib.scm index b71709def4..af48e55c6b 100644 --- a/scm/documentation-lib.scm +++ b/scm/documentation-lib.scm @@ -179,6 +179,13 @@ string-to-use). If QUOTE? is #t, embed table in a @quotation environment." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; property stuff. +(define (verify-type-name where sym type) + (if (eq? type #f) + (ly:error (_ "cannot find description for property `~S' (~S)") + sym + where)) + (type-name type)) + (define (property->texi where sym . rest) "Document SYM for WHERE (which can be translation, backend, music), with init values from ALIST (1st optional argument) @@ -190,7 +197,7 @@ with init values from ALIST (1st optional argument) (doc-name (string->symbol (string-append (symbol->string where) "-doc"))) (type (object-property sym type?-name)) - (typename (type-name type)) + (typename (verify-type-name where sym type)) (desc (object-property sym doc-name)) (init-value (assoc-get sym alist))) -- 2.39.2