-;;; backend-documentation-lib.scm -- Functions for backend documentation
-;;;
-;;; source file of the GNU LilyPond music typesetter
-;;;
-;;; (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-;;; Jan Nieuwenhuizen <janneke@gnu.org>
-
-
-;;; This file generates documentation for the backend of lilypond.
-
-;; alist of property descriptions
-
-;;
-"
-TODO:
-
-
-Grob bla
-
-Created by:
-
- * preset properties + explanation
-
-Interfaces:
-
- * properties available.
-
-"
-
+;;;; document-backend.scm -- Functions for backend documentation
+;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;;
+;;;; (c) 2000--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Jan Nieuwenhuizen <janneke@gnu.org>
+
+(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-ci<?)
+ (list meta))))
+
+;; properly sort all grobs, properties, and interfaces
+;; within the all-grob-descriptions alist
+(map
+ (lambda (x)
+ (let* ((props (assoc-ref all-grob-descriptions (car x)))
+ (meta (assoc-ref props 'meta))
+ (interfaces (assoc-ref meta 'interfaces)))
+ (set! all-grob-descriptions
+ (sort (assoc-set! all-grob-descriptions (car x)
+ (sort-grob-properties
+ (assoc-set! props 'meta
+ (assoc-set! meta 'interfaces
+ (sort interfaces ly:symbol-ci<?)))))
+ ly:alist-ci<?))))
+ all-grob-descriptions)