+(define-extra-display-method ContextSpeccedMusic (expr parser)
+ "If expr is a melisma end, return \"\\melismaEnd\", otherwise, return #f."
+ (with-music-match (expr (music 'ContextSpeccedMusic
+ element (music 'PropertyUnset
+ symbol 'melismaBusy)))
+ "\\melismaEnd"))
+
+;;; \tempo
+(define-extra-display-method SequentialMusic (expr parser)
+ (with-music-match (expr (music 'SequentialMusic
+ elements ((music 'TempoChangeEvent
+ text ?text
+ tempo-unit ?unit
+ metronome-count ?count)
+ (music 'ContextSpeccedMusic
+ element (music 'PropertySet
+ symbol 'tempoWholesPerMinute)))))
+ (format #f "\\tempo ~{~a~a~}~a = ~a~a"
+ (if (markup? ?text)
+ (list (markup->lily-string ?text) " ")
+ '())
+ (duration->lily-string ?unit #:force-duration #t)
+ (if (pair? ?count)
+ (format #f "~a ~~ ~a" (car ?count) (cdr ?count))
+ ?count)
+ (new-line->lily-string))))
+
+(define-display-method TempoChangeEvent (expr parser)
+ (let ((text (ly:music-property expr 'text)))
+ (format #f "\\tempo ~a~a"
+ (markup->lily-string text)
+ (new-line->lily-string))))
+
+;;; \clef
+(define clef-name-alist #f)
+(define-public (memoize-clef-names clefs)
+ "Initialize @code{clef-name-alist}, if not already set."
+ (if (not clef-name-alist)
+ (set! clef-name-alist
+ (map (lambda (name+vals)
+ (cons (cdr name+vals)
+ (car name+vals)))
+ clefs))))
+
+(define-extra-display-method ContextSpeccedMusic (expr parser)
+ "If @var{expr} is a clef change, return \"\\clef ...\".
+Otherwise, return @code{#f}."