I've set up
ert test results to display in a separate frame, if one exists, and in a bottom side-window otherwise:
(add-to-list 'display-buffer-alist '("\\`\\*ert\\*\\'" (display-buffer-reuse-window display-buffer-in-side-window) (reusable-frames . visible) (inhibit-switch-frame . t) (side . bottom)))
In either case, I don't want the results window to gain focus, as I'd rather keep focus on the window I was editing in. So far, I can't find a way to do that.
Even when I've broken off a separate frame for the results, and despite specifying
(inhibit-switch-frame . t), the results frame+window steals focus every time I trigger tests.
I even tried implementing a wrapper function to reselect the original window & frame, but even that isn't working:
(defun my-ert () (let ((original-frame (selected-frame)) (original-window (selected-window))) (ert-run-tests-interactively t) (select-frame original-frame) (select-window original-window)))
What am I missing?