The attached patch adds a :WAIT keyword argument to INSPECT-IN-EMACS. If it is true, INSPECT-IN-EMACS waits for the inspector to be closed in Emacs.
The motivation is to make
(setf sb-impl::*inspect-fun* (lambda (object input output) (declare (ignore input output)) (swank:inspect-in-emacs object :wait t)))
work as a better replacement for the built-in INSPECT, allowing you to eg. insert INSPECT calls into code and having execution block on those calls.
I'm personally happy enough with this, but am not sure if the way I hook into kill-buffer with a closure should be considered abuse or not -- ie. if this is in reasonably good style or a horrible hack.
Cheers,
-- Nikodemus