Home / Emacs / Compilation / Configuration
When a compilation starts, select its window
(with-eval-after-load 'compile
(add-hook 'compilation-start-hook
(lambda (process)
(select-window (get-buffer-window
(process-buffer process))))))