Partition list at repeated element
Join[Most /@ Rest @ Most @ #, {Last @ #}] & @ Split[list, UnsameQ]
{{a, 1, 2, 3}, {b, 5, 6}, {c, 1, 5}, {a, 7, 8, 9, 1}}
You can also use use Split
twice and reorganize the result:
Rest /@ Flatten /@ Split[Split[list], Length @ #2 == 1 &]
{{a, 1, 2, 3}, {b, 5, 6}, {c, 1, 5}, {a, 7, 8, 9, 1}}
And yet an alternative way:
Take[list, {#, #2 - 2}] & @@@
Partition[Last /@ SequencePosition[list, {a_, a_}], 2, 1, 1, {Length[list] + 2}]
{{a, 1, 2, 3}, {b, 5, 6}, {c, 1, 5}, {a, 7, 8, 9, 1}}
SequenceSplit[list, {a_, a_, x:_Integer ..} -> {a,x}]
{{a, 1, 2, 3}, {b, 5, 6}, {c, 1, 5}, {a, 7, 8, 9, 1}}