fully implement prog-mode for older emacsen
changes from CL
no free variables
reformat code