-(define (property->texi where sym)
- "Document SYM for WHERE (which can be translation, backend, music)"
- (let* (
- (name (symbol->string sym))
- (type?-name (string->symbol
- (string-append (symbol->string where) "-type?")))
- (doc-name (string->symbol
- (string-append (symbol->string where) "-doc")))
- (type (object-property sym type?-name))
- (typename (type-name type))
- (desc (object-property sym doc-name)))
+(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)
+"
+ (let* ((name (symbol->string sym))
+ (alist (if (pair? rest) (car rest) '()))
+ (type?-name (string->symbol
+ (string-append (symbol->string where) "-type?")))
+ (doc-name (string->symbol
+ (string-append (symbol->string where) "-doc")))
+ (type (object-property sym type?-name))
+ (typename (verify-type-name where sym type))
+ (desc (object-property sym doc-name))
+ (init-value (assoc-get sym alist)))