]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/document-translation.scm
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scm / document-translation.scm
index 8237260c4555b3897712b25f561d92ca7ecde9ff..8de267f6d94f7e6b6ae27bcbb84620f1c8687146 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2000--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
          (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)
 
 ;; 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))
            (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)
          (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<?))))
 
        "."
 
        (if (and (pair? props) (not (null? props)))
-           (let ((str (apply string-append
-                             (sort (map document-property-operation props)
-                                   ly:string-ci<?))))
+           (let ((str (string-concatenate
+                       (sort (map document-property-operation props)
+                             ly:string-ci<?))))
              (if (string-null? str)
                  ""
                  (string-append
                   "@end itemize\n")))
            "")
 
+       (if defaultchild
+           (format #f "\n\nThis is not a `Bottom' context; search for such a one will commence after creating an implicit context of type @ref{~a}."
+                   defaultchild)
+           "\n\nThis is a `Bottom' context; no contexts will be created implicitly from it.")
+
        (if (null? accepts)
-           "\n\nThis context is a `bottom' context; it cannot contain other contexts."
+           "\n\nThis context cannot contain other contexts."
            (string-append
             "\n\nContext "
             name
                         (list group)
                         '())
                     (assoc-get 'consists context-desc)))
-         (grobs  (apply append
-                        (map engraver-grobs consists))))
+         (grobs (append-map engraver-grobs consists)))
     grobs))
 
 (define (all-contexts-doc)