How to add text marks at the end of a line

By default, rehearsal marks specified at the end of a line are printed at the beginning of the next line (even if it is the end of the piece, in such case the mark isn't printed at all). To avoid this, override the #'break-visibility property of the RehearsalMark object, like in the following snippet.