X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-music.scm;h=4c12b6b1e9a9e39621f688760bec1b315f55ec5a;hb=5091a221086ba923451781a1d51a2a715369b7e4;hp=b1ab6613c49e5933da0673e56f04df8f8775a35b;hpb=12186b6828aee7aa298076d684835d629b757f2a;p=lilypond.git diff --git a/scm/document-music.scm b/scm/document-music.scm index b1ab6613c4..4c12b6b1e9 100644 --- a/scm/document-music.scm +++ b/scm/document-music.scm @@ -2,45 +2,38 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 1998--2004 Han-Wen Nienhuys +;;;; (c) 1998--2007 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen (define (music-props-doc) (make #:name "Music properties" - #:desc "All music properties, including descriptions" + #:desc "All music properties, including descriptions." #:text - (let* ( - (ps (sort (map symbol->string all-music-properties) stringtexi 'music (string->symbol prop))) - ps)) - (texi (description-list->texi descs)) - ) - texi) - )) + (let* ((ps (sort (map symbol->string all-music-properties) stringtexi 'music (string->symbol prop))) + ps)) + (texi (description-list->texi descs))) + texi))) (define music-types->names (make-vector 61 '())) -(map (lambda (entry) - (let* - ( - (types (cdr (assoc 'types (cdr entry) ))) - ) - (map (lambda (type) - (hashq-set! music-types->names type - (cons (car entry) - (hashq-ref music-types->names type '()))) - - ) types) - - )) - music-descriptions) - - +(filter-map (lambda (entry) + (let* ((class (ly:camel-case->lisp-identifier (car entry))) + (classes (ly:make-event-class class))) + (if classes + (map (lambda (cl) + (hashq-set! music-types->names cl + (cons (car entry) + (hashq-ref music-types->names cl '())))) + classes) + #f))) + + music-descriptions) (define (strip-description x) - (cons (symbol->string (car x)) - "")) + (cons (symbol->string (car x)) + "")) (define (music-type-doc entry) (make @@ -49,11 +42,12 @@ (string-append "\nMusic event type @code{" (symbol->string (car entry)) - "} is in Music objects of type " + "} is in music objects of type " (human-listify (sort (map (lambda (x) (ref-ify (symbol->string x))) - (cdr entry)) string @@ -71,62 +65,55 @@ #:children (map music-type-doc (sort - (hash-table->alist music-types->names) alistalist music-types->names) alistlisp-identifier namesym)) + (classes (ly:make-event-class class)) + (event-texi (if classes + (string-append + "\n\nEvent classes:\n" + (human-listify (map ref-ify (map symbol->string classes))) + "." + + "\n\nAccepted by: " + (human-listify + (map ref-ify + (map symbol->string (map ly:translator-name + (filter + (lambda (x) (engraver-accepts-music-types? classes x)) all-engravers-list))))) + ".") + ""))) + (string-append (object-property namesym 'music-description) - "\n\nMusic types:\n" - (human-listify (map ref-ify (map symbol->string types))) - "\n\n" - "\n\nAccepted by: " - (human-listify - (map ref-ify - (map symbol->string (map ly:translator-name - (filter - (lambda (x) (engraver-accepts-music-types? types x)) all-engravers-list))))) - "\n\nProperties: \n" + event-texi + "\n\nProperties:\n" (description-list->texi (map - (lambda (x) (property->texi 'music x props)) - (map car props))) - - ) - )) + (lambda (x) (property->texi 'music x props)) + (map car props)))))) (define (music-object-doc obj) (make #:name (symbol->string (car obj)) - #:text (music-doc-str obj) - )) + #:text (music-doc-str obj))) (define (music-expressions-doc) (make #:name "Music expressions" #:desc "Objects that represent music." #:children - (map music-object-doc music-descriptions) - )) - + (map music-object-doc music-descriptions))) + (define (music-doc-node) (make #:name "Music definitions" - #:desc "Definition of the Input data structures" + #:desc "Definition of the input data structures." #:children (list (music-expressions-doc) (music-types-doc) - (music-props-doc)) - )) - - - - + (music-props-doc))))