I have a background process which when finishes switches to a specific buffer. I don't want this process to interrupt my current isearch if I'm doing one, so I'd like to test if an isearch is in progress, and delay switching to that buffer if it is the case.
How can I do this? I tried checking this-command
from the process handler, but it is nil
for some reason even if I'm in an isearch.