BTW, this:
else if (lnum_to_display % 10 == 0)
tem_it.face_id = tenth_lnum_face_id;
else if (lnum_to_display % 5 == 0)
tem_it.face_id = fifth_lnum_face_id;
else
tem_it.face_id = lnum_face_id;
could also be written
else if (lnum_to_display % 5 != 0)
tem_it.face_id = lnum_face_id;
else if (lnum_to_display % 10 == 0)
tem_it.face_id = tenth_lnum_face_id;
else /* lnum_to_display % 5 == 0 */
tem_it.face_id = fifth_lnum_face_id;
with the idea that 80% of lines fall into the linum_face_id case, so it's better to have it first. But I suspect it's a micro-optimization best left to modern compilers.