- (if (and (eq? (ly:music-property mus 'type) 'ContextSpeccedMusic)
- (eq? (ly:music-property mus 'context-type) type)
- (string? id)
- (not (string-null? id)))
- id
+ (if (eq? (ly:music-property mus 'name) 'ContextSpeccedMusic)
+ (if (and (string? id)
+ (not (string-null? id)))
+ id
+ ;; We may reliably give a new context a unique name, but
+ ;; not an existing one
+ (if (ly:music-property mus 'create-new #f)
+ (let ((id (get-next-unique-voice-name)))
+ (set! (ly:music-property mus 'context-id) id)
+ id)
+ '()))