X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-backend.scm;fp=scm%2Fdocument-backend.scm;h=4d55382fc40bfc6af449d2e11f1be6dcd537c01c;hb=e90f0536f9be39ada0bef0aeb0d275dec3b2fb5b;hp=d77a194d3194c3d79e0d1387d31e05bc444c27bb;hpb=a8c9e8a7ca320ab0df5fd32e717fd62cd7635ce6;p=lilypond.git diff --git a/scm/document-backend.scm b/scm/document-backend.scm index d77a194d31..4d55382fc4 100644 --- a/scm/document-backend.scm +++ b/scm/document-backend.scm @@ -1,14 +1,47 @@ -;;;; backend-documentation-lib.scm -- Functions for backend 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 +;;;; Copyright (C) 2000--2011 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen +;;;; +;;;; 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 . + +(define (sort-grob-properties x) + ;; force 'meta to the end of each prop-list + (let ((meta (assoc 'meta x))) + (append (sort (assoc-remove! x 'meta) ly:alist-citexi 'backend pr grob-description))) @@ -35,13 +68,12 @@ (description-list->texi internal-propdocs #t)) "")))) -(define iface->grob-table (make-vector 61 '())) +(define iface->grob-table (make-hash-table 61)) ;; extract ifaces, and put grob into the hash table. (map (lambda (x) - (let* ((metah (assoc 'meta (cdr x))) - (meta (cdr metah)) - (ifaces (cdr (assoc 'interfaces meta)))) + (let* ((meta (assoc-get 'meta (cdr x))) + (ifaces (assoc-get 'interfaces meta))) (map (lambda (iface) (hashq-set! @@ -61,7 +93,7 @@ (hashq-ref iface->grob-table (car interface) '())) - string #:name name #:text (string-append @@ -88,16 +120,18 @@ "Given a property alist DESCRIPTION, make a documentation node." - (let* ((metah (assoc 'meta description)) - (meta (cdr metah)) - (name (cdr (assoc 'name meta))) + (let* ((meta (assoc-get 'meta description)) + (name (assoc-get 'name meta)) ;; (bla (display name)) - (ifaces (map lookup-interface (cdr (assoc 'interfaces meta)))) - (ifacedoc (map (lambda (iface) - (if (pair? iface) - (ref-ify (symbol->string (car iface))) - (ly:error (_ "pair expected in doc ~s") name))) - (reverse ifaces))) + (ifaces (map lookup-interface (assoc-get 'interfaces meta))) + (ifacedoc (map ref-ify + (sort + (map (lambda (iface) + (if (pair? iface) + (symbol->string (car iface)) + (ly:error (_ "pair expected in doc ~s") name))) + ifaces) + ly:string-cistring lst) stringstring lst) ly:string-citexi 'backend (string->symbol prop) '())) ps)) (texi (description-list->texi descs #f)))