Since compilation buffers go as far as to print the directory they're running on at the top of the buffer, I think it's pretty clear they should receive dir-local variables. So I'd suggest the attached patch, which does that and also removes a more limited mechanism I added some time ago to allow compilation with project-specific settings. I've CC'ed Stefan since at the time he kind of supported the changes I'm now suggesting to remove.