If you want barlines the way you describe, then you probably don't have
unmetered music, but just irregularly metered music. You will probably
want
bar numbers to increase between bars. The only way I can find to do
this, is
to set measureLength individually for each bar, see
5.3.9 Time administration
I think it could be nice to add a command like \newBar to lilypond,
which
would be roughly equivalent to setting measureTiming to measureLength
(except
that this doesn't work). This command should IMHO also be added to
\cadenzaOff. (i.e., after a cadenza is over, a new bar will start). Any
opinions?