I have an Emacs command like following:
(defun query-lisp (word)
(interactive "sType a word to query:")
(message "%s" (query word)))
The query operation is a time-consuming operation. When this command is running Emacs blocks the whole frame. Is there a way to make Emacs run this command in the background or block only a single window such as the minibuffer?
Emacs doesn’t have threads. For long operations you can split up the task into chunks and execute the chunks in idle timers, so emacs can respond to user input between the chunks.
The other possibility is running it as an external process from which emacs accepts the output.