-(for-each
- (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)
+(set! all-grob-descriptions
+ (map!
+ (lambda (grob-description)
+ (let* ((grob-key (car grob-description))
+ (props (assoc-ref all-grob-descriptions grob-key))
+ (meta (assoc-ref props 'meta))
+ (interfaces (assoc-ref meta 'interfaces))
+ (sorted-ifaces (sort interfaces ly:symbol-ci<?))
+ (new-meta (assoc-set! meta 'interfaces sorted-ifaces))
+ (new-props (assoc-set! props 'meta new-meta))
+ (sorted-props (sort-grob-properties new-props)))
+ (cons grob-key sorted-props)))
+ all-grob-descriptions))
+
+;; sort all grobs in the all-grob-descriptions alist
+(set! all-grob-descriptions (sort all-grob-descriptions ly:alist-ci<?))