main snipped for c-mode and c++-mode.