X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-translation.scm;h=8de267f6d94f7e6b6ae27bcbb84620f1c8687146;hb=HEAD;hp=8237260c4555b3897712b25f561d92ca7ecde9ff;hpb=cf137655b7aee9988ef536d6fa5e38d279ee73cf;p=lilypond.git diff --git a/scm/document-translation.scm b/scm/document-translation.scm index 8237260c45..8de267f6d9 100644 --- a/scm/document-translation.scm +++ b/scm/document-translation.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2000--2012 Han-Wen Nienhuys +;;;; Copyright (C) 2000--2015 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify @@ -78,20 +78,19 @@ (let* ((layout-alist (ly:output-description $defaultlayout)) (context-description-alist (map cdr layout-alist)) (contexts - (apply append - (map - (lambda (x) - (let* ((context (assoc-get 'context-name x)) - (group (assq-ref x 'group-type)) - (consists (append - (if group - (list group) - '()) - (assoc-get 'consists x)))) - (if (member name-sym consists) - (list context) - '()))) - context-description-alist))) + (append-map + (lambda (x) + (let* ((context (assoc-get 'context-name x)) + (group (assq-ref x 'group-type)) + (consists (append + (if group + (list group) + '()) + (assoc-get 'consists x)))) + (if (member name-sym consists) + (list context) + '()))) + context-description-alist)) (context-list (human-listify (map ref-ify (sort (map symbol->string contexts) @@ -114,7 +113,7 @@ ;; Second level, part of Context description (define name->engraver-table (make-hash-table 61)) -(map +(for-each (lambda (x) (hash-set! name->engraver-table (ly:translator-name x) x)) (ly:get-all-translators)) @@ -144,18 +143,18 @@ (path (cdr args))) (string-append - "@item Set " - (format #f "grob-property @code{~a} " - (string-join (map symbol->string path) " ")) - (format #f "in @ref{~a} to ~a." - context-sym (scm->texi value)) - "\n"))) + (format #f "@item Set grob-property @code{~{~a~^.~}} " path) + (format #f "in @ref{~a} to" context-sym) + (if (pretty-printable? value) + (format #f ":~a\n" (scm->texi value)) + (format #f " ~a.\n" (scm->texi value)))))) ((equal? (object-property context-sym 'is-grob?) #t) "") ((equal? tag 'assign) - (format #f "@item Set translator property @code{~a} to ~a.\n" - context-sym - (scm->texi (car args)))) - ))) + (string-append + (format #f "@item Set translator property @code{~a} to" context-sym) + (if (pretty-printable? (car args)) + (format #f ":~a\n" (scm->texi (car args))) + (format #f " ~a.\n" (scm->texi (car args))))))))) (define (context-doc context-desc) @@ -166,6 +165,7 @@ (accepts (assoc-get 'accepts context-desc)) (consists (assoc-get 'consists context-desc)) (props (assoc-get 'property-ops context-desc)) + (defaultchild (assoc-get 'default-child context-desc)) (grobs (context-grobs context-desc)) (grob-refs (map ref-ify (sort grobs ly:string-ci