I use emacs to edit a number of file types, and would like an easy visual queue to tell .c files from .vhd or .py files, for instance. How can I add a custom background col
You cannot set the background color on a buffer-by-buffer basis. See the SU question How can I change the background colour of a single emacs buffer?.
The first answer there shows how you can change the background for a single Emacs frame, which might work for you if you have one frame per file (or per mode).