after-change-major-mode-hook on next-error-hook

This properly sets the window dimming when using modes that implement
`next-error` by undimming the buffer of the error you are jumping to.
dimming/undimming when gaining/losing app focus

This will dim all windows when you lose focus of Emacs 24.4+ and undim
the active buffer when you gain focus back. It's helpful for something
like a multi-monitor setup where you need to know which screen's app
currently has focus.