]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/document-translation.scm
Revert "Clean up declarations-init.ly, paper-defaults-init.ly."
[lilypond.git] / scm / document-translation.scm
index 390d6b0330a86ad5ce8c3ead39db54bef000d50e..9f4c788443579f5b9f5cffed7b96b4e8b589eaf4 100644 (file)
@@ -1,9 +1,20 @@
-;;;; document-translation.scm -- Functions for engraver documentation
+;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2000--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2000--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;;
+;;;; LilyPond is free software: you can redistribute it and/or modify
+;;;; it under the terms of the GNU General Public License as published by
+;;;; the Free Software Foundation, either version 3 of the License, or
+;;;; (at your option) any later version.
+;;;;
+;;;; LilyPond is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;;; GNU General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU General Public License
+;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 
 (define (engraver-makes-grob? name-symbol grav)
   (memq name-symbol (assoc 'grobs-created (ly:translator-description grav))))
        (engraver-accepts-music-types? (cdr types) grav))))
 
 (define (engraver-doc-string engraver in-which-contexts)
-  (let* ((propsr (cdr (assoc 'properties-read (ly:translator-description engraver))))
-        (propsw (cdr (assoc 'properties-written (ly:translator-description engraver))))
-        (accepted  (cdr (assoc 'events-accepted (ly:translator-description engraver))))
+  (let* ((propsr (assoc-get 'properties-read (ly:translator-description engraver)))
+        (propsw (assoc-get 'properties-written (ly:translator-description engraver)))
+        (accepted  (assoc-get 'events-accepted (ly:translator-description engraver)))
         (name-sym  (ly:translator-name engraver))
         (name-str (symbol->string name-sym))
-        (desc (cdr (assoc 'description (ly:translator-description engraver))))
+        (desc (assoc-get 'description (ly:translator-description engraver)))
         (grobs (engraver-grobs engraver)))
 
     (string-append
                 (apply append
                        (map
                         (lambda (x)
-                          (let* ((context (cdr (assoc 'context-name x)))
+                          (let* ((context (assoc-get 'context-name x))
                                  (group (assq-ref x 'group-type))
                                  (consists (append
                                             (if group
                                                 (list group)
                                                 '())
-                                            (cdr (assoc 'consists x)))))
+                                            (assoc-get 'consists x))))
                             (if (member name-sym consists)
                                 (list context)
                                 '())))
 
 
 (define (context-doc context-desc)
-  (let* ((name-sym (cdr (assoc 'context-name context-desc)))
+  (let* ((name-sym (assoc-get 'context-name context-desc))
         (name (symbol->string name-sym))
-        (aliases (map symbol->string (cdr (assoc 'aliases context-desc))))
-        (desc-handle (assoc 'description context-desc))
-        (desc (if (and  (pair? desc-handle) (string? (cdr desc-handle)))
-                  (cdr desc-handle) "(not documented)"))
-       
-        (accepts (cdr (assoc 'accepts context-desc)))
-        (consists (cdr (assoc 'consists context-desc)))
-        (props (cdr (assoc 'property-ops context-desc)))
+        (aliases (map symbol->string (assoc-get 'aliases context-desc)))
+        (desc (assoc-get 'description context-desc "(not documented"))
+        (accepts (assoc-get 'accepts context-desc))
+        (consists (assoc-get 'consists context-desc))
+        (props (assoc-get 'property-ops context-desc))
         (grobs  (context-grobs context-desc))
         (grob-refs (map ref-ify (sort grobs ly:string-ci<?))))
 
                 grav)))
     (if (eq? eg #f)
        '()
-       (map symbol->string (cdr (assoc 'grobs-created (ly:translator-description eg)))))))
+       (map symbol->string (assoc-get 'grobs-created (ly:translator-description eg))))))
 
 (define (context-grobs context-desc)
   (let* ((group (assq-ref context-desc 'group-type))
                    (if group
                        (list group)
                        '())
-                   (cdr (assoc 'consists context-desc))))
+                   (assoc-get 'consists context-desc)))
         (grobs  (apply append
                        (map engraver-grobs consists))))
     grobs))